【问题标题】:wpf popup shadow not showingwpf弹出阴影不显示
【发布时间】:2017-05-03 14:56:27
【问题描述】:

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

    <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.什么问题?!!

【问题讨论】:

    标签: wpf popup shadow


    【解决方案1】:

    投影在Popup 的内边缘处被截断。在 Popup 中为其留出更多空间,方法是为 Border 留出足够的边距,以便为其周围的阴影留出空间。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-09-06
      • 2016-04-30
      • 1970-01-01
      • 1970-01-01
      • 2011-12-09
      • 2017-09-10
      • 2019-12-23
      相关资源
      最近更新 更多