15

I want to set shadow for popup in my project.but when I run it, the shadow does not appear. I wrote this codes:

    <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>

in design shadow show.in run not show.what is problem?!!

ΩmegaMan
  • 29,542
  • 12
  • 100
  • 122
Mohadeseh
  • 360
  • 4
  • 19

1 Answers1

16

The drop shadow is getting cut off at the inner edge of the Popup. Make more room for it in the Popup by giving the Border a sufficient margin to create room for the shadow to be seen around it.