Silverlight clipping inside grid
I have a Grid
and I'd like to apply a Clip
( I provide Path
Data
) to anything that is inside the Grid
. For e开发者_StackOverflow中文版.g., if I have an image inside the grid, I need the image to be clipped to a custom shape. How can I achieve this?
Yes, you can set the Clip
property on the Grid
to the geometry that you want to clip to. Alternatively, there is an attached behaviour described in the following blog post:
http://www.scottlogic.co.uk/blog/colin/2009/05/silverlight-cliptobounds-can-i-clip-it-yes-you-can/
That can be used as follows:
<Grid util:Clip.ToBounds="true">
精彩评论