Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

wpf popup shadow not showing

Tags:

wpf

shadow

popup

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

like image 442
Mohadeseh Avatar asked May 03 '17 14:05

Mohadeseh


1 Answers

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.

like image 82
15ee8f99-57ff-4f92-890c-b56153 Avatar answered Oct 14 '22 00:10

15ee8f99-57ff-4f92-890c-b56153