我希望网格在屏幕上伸展同时还应用了阴影效果,出于某种原因,当放置在DropShadowPanel内部时,我无法将网格拉伸.
以下是所需结果的示例,但没有阴影效果:
<Grid Background="LightBlue">
<Grid Background="WhiteSmoke" HorizontalAlignment="Stretch" Height="200" VerticalAlignment="Top" Margin="40"/>
</Grid>
Run Code Online (Sandbox Code Playgroud)
结果:
这是我的带有DropShadowPanel的xaml:
<Grid Background="LightBlue">
<controls:DropShadowPanel HorizontalAlignment="Stretch" Margin="40">
<Grid Background="WhiteSmoke" HorizontalAlignment="Stretch" Height="200" VerticalAlignment="Top"/>
</controls:DropShadowPanel>
</Grid>
Run Code Online (Sandbox Code Playgroud)
而这完全隐藏了第二个网格.
为什么网格在DropShadowPanel中的行为不同?