-
Notifications
You must be signed in to change notification settings - Fork 1.4k
UIElement.ClipToBounds property #3111
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
UIElement.ClipToBounds property #3111
Conversation
Thanks for opening a Pull Request! The reviewers will test the PR and highlight if there is any conflict or changes required. If the PR is approved we will proceed to merge the pull request 🙌 |
Looks fine, but I think similar to the actual Does the inside InsetClip that gets created need any of it's properties exposed? Should we expose it in another attached property or something? |
@michael-hawker If we want to create a sample app, and example of the visualization could be to have an item contained in some parent (eg. a As for additional properties, yeah, the |
@Sergio0694 , I have a sample ready for the <Grid Padding="120">
<Grid
BorderBrush="White"
BorderThickness="1"
Width="148"
Height="148"
extensions:FrameworkElementExtensions.ClipToBounds="@[Clip to Bounds:Bool:True]">
<Rectangle Fill="Blue" Width="100" Height="100">
<Rectangle.RenderTransform>
<TranslateTransform X="-50" Y="-50" />
</Rectangle.RenderTransform>
</Rectangle>
<Rectangle Fill="Green" Width="100" Height="100">
<Rectangle.RenderTransform>
<TranslateTransform X="50" Y="50" />
</Rectangle.RenderTransform>
</Rectangle>
</Grid>
</Grid> |
Hey @vgromfeld - that'd be perfect, thank you! I had quite a few things going on at the moment so I couldn't get to writing the sample down for this PR yet, so that'd help! Other than that I guess we should just decide whether to leave this extension as is or to also add some way for users to specifically set the exact margins (like @michael-hawker mentioned a while back), and then this PR should be good to go and ready for review 😄 |
Closing this to continue the work in #3193 then 👍 |
Moved to Windows Community Toolkit: CommunityToolkit/WindowsCommunityToolkit#3111
This PR is part of the group being tracked in #3108.
PR Type
What kind of change does this PR introduce?
What is the new behavior?
A XAML attached property that uses a composition
InsetClip
to clip the rendering coming from inside a givenUIElement
. All additional info can be found in the linked issue.PR Checklist
Please check if your PR fulfills the following requirements:
Other information
Marking this as draft since I haven't created the PR for the docs yet, or added a sample in the app.