-
Notifications
You must be signed in to change notification settings - Fork 705
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
Add CornerRadiusFilterConverter and fix FlipView corner radius #967
Conversation
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 guess I should add test for the converter, adding it now
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.
Also follow up with @MikeHillberg about API review.
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.
See comments.
You should be sure up document how it works, so future controls being made, know how to handle their corner radii in the right way |
winrt::hstring const& language) | ||
{ | ||
auto radius = unbox_value<winrt::CornerRadius>(value); | ||
auto filter = unbox_value<winrt::hstring>(parameter); |
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.
Is it possible to make this an enum? Or does that make things more complicated to author in the markup?
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 just tried but looks like the auto string-enum conversion only works in style setters, and using the enum type directly in xaml didn't seem to work either.
I've added an invalid arg exception to help enforce the values.
return; | ||
} | ||
|
||
RunOnUIThread.Execute(() => { |
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.
Optional: You could just directly invoke the CornerRadiusFilterConverter directly, without the need to instantiate any UIElements or Xaml.
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.
Yeah I was thinking of doing that too at first, but I think we'll probably never use the converter directly in code, going through xaml is closer to our real use cases.
🎉 Handy links: |
Added a converter to filter corner radius on a specific direction. Applied it to FlipView to get the non-uniform corner radius on arrow buttons.