ContextMenuStyles.xaml 1.3 KB

12345678910111213141516171819202122
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  3. <Style x:Key="MenuItemStyle" TargetType="{x:Type MenuItem}">
  4. <Setter Property="Foreground" Value="{DynamicResource NormalTextForeground}"/>
  5. </Style>
  6. <Style x:Key="ContextMenuStyle" TargetType="{x:Type ContextMenu}">
  7. <Setter Property="Background" Value="{DynamicResource ContextMenuBackground}"/>
  8. <Setter Property="OverridesDefaultStyle" Value="True"/>
  9. <Setter Property="SnapsToDevicePixels" Value="True"/>
  10. </Style>
  11. <Style x:Key="IconlessContextMenuStyle" TargetType="{x:Type ContextMenu}" BasedOn="{StaticResource ContextMenuStyle}">
  12. <Setter Property="Template">
  13. <Setter.Value>
  14. <ControlTemplate TargetType="{x:Type ContextMenu}">
  15. <Border x:Name="Border" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="4" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
  16. <StackPanel ClipToBounds="True" Orientation="Vertical" IsItemsHost="True"/>
  17. </Border>
  18. </ControlTemplate>
  19. </Setter.Value>
  20. </Setter>
  21. </Style>
  22. </ResourceDictionary>