【问题标题】:Round DropShadowPanel圆形 DropShadowPanel
【发布时间】:2019-10-10 09:16:58
【问题描述】:

如何创建一个回合DropShadowPanel?这个question 提供了一些想法,但我仍然得到一个方形阴影。

这是我目前的尝试:

<Grid>
    <controls:DropShadowPanel
        x:Name="ShadowPanel"
        BlurRadius="10"
        ShadowOpacity="1">
        <Ellipse Width="120" Height="120" />
    </controls:DropShadowPanel>
    <Grid
        Width="120"
        Height="120"
        Background="DarkGray"
        CornerRadius="60">
        <FontIcon
            FontSize="50"
            Foreground="White"
            Glyph="&#xE8D4;" />
    </Grid>
</Grid>

基本上,我希望DropShadowPanel 具有与内部网格相同的形状。

【问题讨论】:

    标签: xaml uwp win-universal-app


    【解决方案1】:

    请尝试以下代码并设置Ellipse 的颜色。 DropShadowPanel 将起作用。

    <Grid>
        <controls:DropShadowPanel
            x:Name="ShadowPanel"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            BlurRadius="15"
            Opacity="1"
            ShadowOpacity="1"
            Color="Black"
            >
            <Ellipse
                Width="120"
                Height="120"
                Fill="White"
                />
        </controls:DropShadowPanel>
        <Grid
            Width="120"
            Height="120"
            Background="DarkGray"
            CornerRadius="60"
            >
            <FontIcon
                FontSize="50"
                Foreground="White"
                Glyph="&#xE8D4;"
                />
        </Grid>
    </Grid>
    

    【讨论】:

    • 啊,我错过了Fill Ellipse...谢谢!
    猜你喜欢
    • 2013-09-11
    • 1970-01-01
    • 1970-01-01
    • 2022-01-17
    • 2018-01-05
    • 2017-12-25
    • 2016-02-14
    • 1970-01-01
    • 2020-12-17
    相关资源
    最近更新 更多