MenuStyle.xaml 1.2 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="ToolsMenuStyle" TargetType="{x:Type MenuItem}">
  4. <Setter Property="Background" Value="White"></Setter>
  5. <Setter Property="Margin" Value="0,0,0,0"></Setter>
  6. <Setter Property="Padding" Value="0,10,10,20"></Setter>
  7. <Setter Property="Template">
  8. <Setter.Value>
  9. <ControlTemplate TargetType="{x:Type MenuItem}">
  10. <Border Padding="17,0,17,0" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
  11. <ContentPresenter x:Name="ContentPresenter" Content="{TemplateBinding Header}" Grid.Column="1" ContentSource="Header" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
  12. </Border>
  13. <ControlTemplate.Triggers>
  14. <Trigger Property="IsMouseOver" Value="True">
  15. <Setter Property="Background" Value="whitesmoke"/>
  16. </Trigger>
  17. </ControlTemplate.Triggers>
  18. </ControlTemplate>
  19. </Setter.Value>
  20. </Setter>
  21. </Style>
  22. </ResourceDictionary>