小编Cal*_*ell的帖子

UWPCommunityToolkit DropShadowPanel使Grid不会拉伸

我希望网格在屏幕上伸展同时还应用了阴影效果,出于某种原因,当放置在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中的行为不同?

xaml uwp uwp-xaml windows-community-toolkit

2
推荐指数
1
解决办法
156
查看次数

标签 统计

uwp ×1

uwp-xaml ×1

windows-community-toolkit ×1

xaml ×1