开发者

How to hide WPF Grid Overflow (like CSS overflow:hidden)

I'm curren开发者_运维技巧tly creating a metro styled app. Because of this I need to extend my client area out of my window to draw the shadow. The problem now is that I have a button set to Margin="0,0,15,15" and of course it draws itself also in this shadow area. How can I hide this? In CSS I would just apply overflow:hidden to the "Content" or the UserControl.

How to hide WPF Grid Overflow (like CSS overflow:hidden)

The basic WPF structure is like this:

<Grid x:Name="LayoutRoot" SnapsToDevicePixels="True" Margin="15" Background="White">
    <Grid.Effect>
        <DropShadowEffect ShadowDepth="0" BlurRadius="15" Direction="470"/>
    </Grid.Effect>
        <Grid x:Name="Content">
        <UserControl></UserControl> // This is where the arrow button is with Margin="0,0,15,15"
    </Grid>
</Grid>


Normally you can use some container and set its ClipToBounds to true.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜