Skip to content
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

Merged
merged 7 commits into from
Jul 2, 2019

Conversation

kaiguo
Copy link
Contributor

@kaiguo kaiguo commented Jun 27, 2019

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.

20190627153736

@kaiguo kaiguo requested review from jevansaks and chrisglein June 27, 2019 22:52
@kaiguo kaiguo requested a review from a team as a code owner June 27, 2019 22:52
@kaiguo kaiguo self-assigned this Jun 27, 2019
Copy link
Contributor Author

@kaiguo kaiguo left a 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

Copy link
Member

@jevansaks jevansaks left a 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.

dev/Common/Converters.cpp Outdated Show resolved Hide resolved
dev/Common/Converters.idl Outdated Show resolved Hide resolved
dev/Common/Converters.idl Outdated Show resolved Hide resolved
Copy link
Member

@kmahone kmahone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments.

@mdtauk
Copy link
Contributor

mdtauk commented Jun 28, 2019

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

@jevansaks jevansaks added the release note PR that we want to call out in the next release summary label Jun 28, 2019
winrt::hstring const& language)
{
auto radius = unbox_value<winrt::CornerRadius>(value);
auto filter = unbox_value<winrt::hstring>(parameter);
Copy link
Member

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?

Copy link
Contributor Author

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.

dev/Common/Converters.cpp Show resolved Hide resolved
@jevansaks jevansaks dismissed their stale review July 2, 2019 18:29

Don't block on me

return;
}

RunOnUIThread.Execute(() => {
Copy link
Member

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.

Copy link
Contributor Author

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.

@kaiguo kaiguo merged commit c42f076 into master Jul 2, 2019
@kaiguo kaiguo deleted the user/kaiguo/corner-radius-converter branch July 2, 2019 19:30
@msft-github-bot
Copy link
Collaborator

🎉Microsoft.UI.Xaml v2.2.190731001-prerelease has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Styling release note PR that we want to call out in the next release summary
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants