-
Notifications
You must be signed in to change notification settings - Fork 3.5k
ToggleButton uses EllipseClipConverter #3867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ToggleButton uses EllipseClipConverter #3867
Conversation
| using System.Windows.Data; | ||
| using System.Windows.Media; | ||
|
|
||
| namespace MaterialDesignThemes.Wpf.Converters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: We have been favoring file-scoped namespaces
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed good to keep consistency in the code base: Fixed
|
Not that we need it, and I'm just asking out of curiosity: At work we always add tests for every converter to (obviously) test it, and also to show intent of what the converter is supposed to do. Sometimes it could be hard to fit a converters purpose into it's name. Especially because converters are this well encapsulated/standalone "component" it seems like a nobrainer to add tests for it. |
|
@corvinsz I don't believe we have a rule/guideline stating that you must or must not add tests for them. Personally I have added a few tests when the logic grows to be non-trivial. However, I like your comment about the tests indicating intent, because naming is hard! and I have often found myself scratching my head looking a converter name trying to decipher what its purpose in life is. So in short, I think you're more than welcome to add tests, especially fast running "unit tests". The more safety net, the better IMO. |
|
Neat. After @Keboo has successfully converted and merged all the tests to TUnit - and I can spare some time - I can take a look at adding tests for converters. |
ToggleButton now uses an EllipseClipConverter to create the Ellipse for clipping of button.
This fixes some binding errors like: System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=Width; DataItem=null; target element is 'EllipseGeometry' (HashCode=37186555); target property is 'RadiusX' (type 'Double')