我创建了一个没有样式的窗口并添加了自定义边框。我需要我的窗户投下阴影。
<Border BorderBrush="#000000 "
BorderThickness="1,0,1,1" Width="400"
Height="400"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
CornerRadius="10, 10, 0, 0"
Background="Black">
<Border.Effect>
<DropShadowEffect Color="Black" Direction="320"
ShadowDepth="5" Opacity="1" BlurRadius="5" />
</Border.Effect></Border>
但是当我像这样设置宽度和高度时,我的阴影消失了:
Width="{Binding RelativeSource={RelativeSource FindAncestor,
AncestorType={x:Type Window}}, Path=Width}"
请帮我找到解决方案。谢谢