我是WPF技术的新手。我在WPF中有以下窗口声明:WPF窗口阴影效果
<Window x:Class="CustomWindows.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="480" Width="640" ScrollViewer.VerticalScrollBarVisibility="Disabled" WindowStyle="None" AllowsTransparency="True">
<Window.Effect>
<DropShadowEffect BlurRadius="15" Direction="-90" RenderingBias="Quality" ShadowDepth="2"/>
</Window.Effect>
<Grid>
</Grid>
</Window>
但是当我运行它时,阴影不会出现。我该怎么做,或者误会在哪里?
除了@HighCore的答案,也可能是因为它是超越绘制区域并将窗口的边距设置为与阴影深度的值相同也可以工作。 – Silvermind
@Silvermind,你的方法不起作用。阴影仍然无法显示... – Victor
这是我的头顶,值得一试imho :)。无论如何,HighCore的答案就足够了。 – Silvermind