ContextMenuBaseStyle.xaml 1.6 KB

12345678910111213141516171819202122232425
  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="ContextMenuBaseStyle" TargetType="ContextMenu">
  4. <Setter Property="hc:MenuAttach.ItemPadding" Value="{StaticResource DefaultControlPadding}" />
  5. <Setter Property="hc:MenuAttach.PopupVerticalOffset" Value="-9" />
  6. <Setter Property="hc:MenuAttach.PopupHorizontalOffset" Value="10" />
  7. <Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
  8. <Setter Property="SnapsToDevicePixels" Value="True"/>
  9. <Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" />
  10. <Setter Property="Padding" Value="2,2,2,0" />
  11. <Setter Property="Template">
  12. <Setter.Value>
  13. <ControlTemplate TargetType="ContextMenu">
  14. <Border Effect="{StaticResource EffectShadow2}" Margin="8" Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" MaxHeight="{TemplateBinding MaxHeight}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}">
  15. <ScrollViewer Style="{StaticResource ScrollViewerUpDown}" Margin="{TemplateBinding Padding}">
  16. <ItemsPresenter/>
  17. </ScrollViewer>
  18. </Border>
  19. </ControlTemplate>
  20. </Setter.Value>
  21. </Setter>
  22. </Style>
  23. </ResourceDictionary>