wpf弹出阴影不显示

Moh*_*seh 11 wpf popup shadow

我想在我的项目中为弹出窗口设置阴影.但是当我运行它时,阴影不会出现.我写了这个代码:

    <Popup x:Name="popup" IsOpen="False"   Width="200" Height="200" Placement="AbsolutePoint" AllowsTransparency="True" PopupAnimation="Fade"   >
        <Grid>
            <Border  BorderThickness="1" Background="#FF4CAAC7" CornerRadius="6" >
                <Border.Effect>
                    <DropShadowEffect BlurRadius="15" Opacity="0.8"  ShadowDepth="10" Direction="-90" RenderingBias="Quality" />
                </Border.Effect>
                <StackPanel Orientation="Horizontal">
                    <Grid Width="200" Background="Transparent">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <TextBlock Grid.Row="0" FontWeight="Bold" TextAlignment="Right" Margin="10">Operation was successful</TextBlock>
                    </Grid>
                </StackPanel>
            </Border>
        </Grid>
    </Popup>
Run Code Online (Sandbox Code Playgroud)

在设计阴影show.in运行不显示.什么是问题?!!

15e*_*153 9

阴影在内缘处被切断Popup.通过为边框提供足够的余量为其周围的阴影创造空间,为Popup腾出更多空间.

<Border 
    BorderThickness="1" 
    Background="#FF4CAAC7" 
    CornerRadius="6" 
    Margin="0,0,15,15"
    >
Run Code Online (Sandbox Code Playgroud)