-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Refactor fix for 2689 to use attached properties #2762
Refactor fix for 2689 to use attached properties #2762
Conversation
Added attached properties for UniformCornerRadius and Style. These properties are inherited and can thus be used to manipulate a Card located inside of another UIElement (eg. the Flipper).
Fallback to default(Style) if the TargetType is not Card.
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.
Looks pretty close, just a couple changes.
@@ -0,0 +1,34 @@ | |||
namespace MaterialDesignThemes.Wpf; | |||
|
|||
public static class CardAssist |
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.
I would rename this to FlipperAssist
since the consumption is designed for flippers not cards, even though the target of the property is a card.
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.
I agree, I'll rename it.
…d property) You mentioned on stream that fact that derived types would not work for the CardStyle because of the guard which is completely correct. So I loosened up the requirements by using IsAssignableFrom() instead.
Rename operation did not pick up the string literal in these tests
Refactoring of previous fix for #2689
Added attached properties for UniformCornerRadius and Style. These properties are inherited and can thus be used to manipulate a Card located inside of another UIElement (eg. the Flipper). I decided to put them in a CardAssist file to align with the other attached properties in the toolkit. It could be moved to the Card type if that is more desirable.
Added more unit- and UI tests for this as well. Also fixed a bug in the original elevated card style (UniformCornerRadius binding) caught by these tests.