我想覆盖ContextMenu
' 样式。
这是我的风格:
<SolidColorBrush x:Key="WindowBackgroundBrush" Color="#E7E8EC" />
<SolidColorBrush x:Key="SolidBorderBrush" Color="#CCCEDB" />
<Color x:Key="DropShadowColor">#808080</Color>
<Style TargetType="{x:Type ContextMenu}">
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="OverridesDefaultStyle" Value="True"/>
<Setter Property="FontFamily" Value="Segoe UI"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ContextMenu}">
<Border Name="Border" Background="{StaticResource WindowBackgroundBrush}" BorderBrush="{StaticResource SolidBorderBrush}" BorderThickness="1" >
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle"/>
<Border.Effect>
<DropShadowEffect Color="{StaticResource DropShadowColor}" Opacity="0.60" ShadowDepth="4"/>
</Border.Effect>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
我不知道为什么,但是阴影不起作用(我没有看到阴影)。
我该如何解决?