chore(style): add Menu small style.

This commit is contained in:
NaBian committed 2022-06-16 23:41:21 +08:00
1 parent 691fb88849
commit ad5de3a45e
9 files changed
+129 -38

No files matched your search

@@ -6429,8 +6429,7 @@
</Style.Triggers> </Style.Triggers>
</Style> </Style>
<Style x:Key="MenuItemBaseStyle" TargetType="MenuItem"> <Style x:Key="MenuItemBaseStyle" TargetType="MenuItem">
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}" /> <Setter Property="Padding" Value="{Binding Path=(hc:MenuAttach.ItemPadding),RelativeSource={RelativeSource AncestorType=MenuBase}}" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Background" Value="Transparent" /> <Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" /> <Setter Property="BorderThickness" Value="0" />
<Setter Property="hc:ScrollViewer.PanningMode" Value="Both" /> <Setter Property="hc:ScrollViewer.PanningMode" Value="Both" />
@@ -6588,7 +6587,7 @@
</Border> </Border>
<ContentPresenter TextElement.Foreground="{TemplateBinding Foreground}" Margin="0,3" x:Name="ContentPresenter" ContentTemplate="{TemplateBinding HeaderTemplate}" Grid.Column="1" ContentSource="Header" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> <ContentPresenter TextElement.Foreground="{TemplateBinding Foreground}" Margin="0,3" x:Name="ContentPresenter" ContentTemplate="{TemplateBinding HeaderTemplate}" Grid.Column="1" ContentSource="Header" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<Path x:Name="Path" Grid.Column="4" Width="10" Height="10" HorizontalAlignment="Left" Data="{StaticResource RightGeometry}" Stretch="Uniform" Fill="{TemplateBinding Foreground}" VerticalAlignment="Center" /> <Path x:Name="Path" Grid.Column="4" Width="10" Height="10" HorizontalAlignment="Left" Data="{StaticResource RightGeometry}" Stretch="Uniform" Fill="{TemplateBinding Foreground}" VerticalAlignment="Center" />
<Popup Grid.Column="1" x:Name="PART_Popup" AllowsTransparency="True" Focusable="False" IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" VerticalOffset="-9" HorizontalOffset="10"> <Popup Grid.Column="1" x:Name="PART_Popup" AllowsTransparency="True" Focusable="False" IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" VerticalOffset="{Binding Path=(hc:MenuAttach.PopupVerticalOffset),RelativeSource={RelativeSource AncestorType=MenuBase}}" HorizontalOffset="{Binding Path=(hc:MenuAttach.PopupHorizontalOffset),RelativeSource={RelativeSource AncestorType=MenuBase}}">
<Border Effect="{StaticResource EffectShadow2}" Margin="8" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="SubMenuBorder" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}"> <Border Effect="{StaticResource EffectShadow2}" Margin="8" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="SubMenuBorder" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}">
<ScrollViewer Style="{StaticResource ScrollViewerUpDown}" Margin="2,2,2,0"> <ScrollViewer Style="{StaticResource ScrollViewerUpDown}" Margin="2,2,2,0">
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Cycle" Grid.IsSharedSizeScope="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.TabNavigation="Cycle" /> <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Cycle" Grid.IsSharedSizeScope="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.TabNavigation="Cycle" />
@@ -6615,11 +6614,10 @@
</Style.Triggers> </Style.Triggers>
</Style> </Style>
<Style x:Key="MenuBaseStyle" TargetType="Menu"> <Style x:Key="MenuBaseStyle" TargetType="Menu">
<Setter Property="OverridesDefaultStyle" Value="True" /> <Setter Property="hc:MenuAttach.ItemPadding" Value="{StaticResource DefaultControlPadding}" />
<Setter Property="hc:MenuAttach.PopupVerticalOffset" Value="-9" />
<Setter Property="hc:MenuAttach.PopupHorizontalOffset" Value="10" />
<Setter Property="Background" Value="{DynamicResource RegionBrush}" /> <Setter Property="Background" Value="{DynamicResource RegionBrush}" />
<Setter Property="FontSize" Value="12" />
<Setter Property="FontStyle" Value="Normal" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" /> <Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
<Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" /> <Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" />
@@ -7121,6 +7119,11 @@
</Style> </Style>
<Style BasedOn="{StaticResource MenuItemBaseStyle}" TargetType="MenuItem" /> <Style BasedOn="{StaticResource MenuItemBaseStyle}" TargetType="MenuItem" />
<Style BasedOn="{StaticResource MenuBaseStyle}" TargetType="Menu" /> <Style BasedOn="{StaticResource MenuBaseStyle}" TargetType="Menu" />
<Style x:Key="Menu.Small" BasedOn="{StaticResource MenuBaseStyle}" TargetType="Menu">
<Setter Property="hc:MenuAttach.ItemPadding" Value="6,0" />
<Setter Property="hc:MenuAttach.PopupVerticalOffset" Value="-3" />
<Setter Property="hc:MenuAttach.PopupHorizontalOffset" Value="6" />
</Style>
<ControlTemplate x:Key="BadgeTextTemplate" TargetType="hc:Badge"> <ControlTemplate x:Key="BadgeTextTemplate" TargetType="hc:Badge">
<hc:SimplePanel> <hc:SimplePanel>
<ContentPresenter /> <ContentPresenter />
@@ -8088,6 +8091,9 @@
</Setter> </Setter>
</Style> </Style>
<Style x:Key="ContextMenuBaseStyle" TargetType="ContextMenu"> <Style x:Key="ContextMenuBaseStyle" TargetType="ContextMenu">
<Setter Property="hc:MenuAttach.ItemPadding" Value="{StaticResource DefaultControlPadding}" />
<Setter Property="hc:MenuAttach.PopupVerticalOffset" Value="-9" />
<Setter Property="hc:MenuAttach.PopupHorizontalOffset" Value="10" />
<Setter Property="Background" Value="{DynamicResource RegionBrush}" /> <Setter Property="Background" Value="{DynamicResource RegionBrush}" />
<Setter Property="SnapsToDevicePixels" Value="True" /> <Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" /> <Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" />
@@ -12595,6 +12601,11 @@
<Style TargetType="hc:ListClock" BasedOn="{StaticResource ListClockBaseStyle}" /> <Style TargetType="hc:ListClock" BasedOn="{StaticResource ListClockBaseStyle}" />
<Style BasedOn="{StaticResource ColorPickerBaseStyle}" TargetType="hc:ColorPicker" /> <Style BasedOn="{StaticResource ColorPickerBaseStyle}" TargetType="hc:ColorPicker" />
<Style BasedOn="{StaticResource ContextMenuBaseStyle}" TargetType="ContextMenu" /> <Style BasedOn="{StaticResource ContextMenuBaseStyle}" TargetType="ContextMenu" />
<Style x:Key="ContextMenu.Small" BasedOn="{StaticResource ContextMenuBaseStyle}" TargetType="ContextMenu">
<Setter Property="hc:MenuAttach.ItemPadding" Value="6,0" />
<Setter Property="hc:MenuAttach.PopupVerticalOffset" Value="-3" />
<Setter Property="hc:MenuAttach.PopupHorizontalOffset" Value="6" />
</Style>
<Style BasedOn="{StaticResource CoverFlowBaseStyle}" TargetType="hc:CoverFlow" /> <Style BasedOn="{StaticResource CoverFlowBaseStyle}" TargetType="hc:CoverFlow" />
<Style BasedOn="{StaticResource CoverViewBaseStyle}" TargetType="hc:CoverView" /> <Style BasedOn="{StaticResource CoverViewBaseStyle}" TargetType="hc:CoverView" />
<Style x:Key="DataGridBaseStyle" TargetType="DataGrid"> <Style x:Key="DataGridBaseStyle" TargetType="DataGrid">
@@ -6,20 +6,39 @@
xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension" xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension"
Background="{DynamicResource RegionBrush}"> Background="{DynamicResource RegionBrush}">
<hc:TransitioningContentControl> <hc:TransitioningContentControl>
<hc:SimplePanel Margin="32"> <hc:UniformSpacingPanel Spacing="16" Margin="32">
<TextBlock Text="{ex:Lang Key={x:Static langs:LangKeys.RightClickHere}}" Foreground="{DynamicResource BorderBrush}" Style="{StaticResource TextBlockTitle}"/> <hc:DashedBorder Width="200" Height="112" Background="Transparent" CornerRadius="4" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" BorderDashArray="2,2">
<Rectangle Width="200" Height="112" RadiusX="4" RadiusY="4" Stroke="{DynamicResource BorderBrush}" StrokeDashArray="2,2"/> <hc:DashedBorder.ContextMenu>
<Border Width="200" Height="112" Background="Transparent"> <ContextMenu ItemsSource="{Binding DataList}">
<Border.ContextMenu> <ContextMenu.ItemTemplate>
<ContextMenu ItemsSource="{Binding DataList}"> <HierarchicalDataTemplate ItemsSource="{Binding DataList}">
<ContextMenu.ItemTemplate> <TextBlock Text="{Binding Name}" />
<HierarchicalDataTemplate ItemsSource="{Binding DataList}"> </HierarchicalDataTemplate>
<TextBlock Text="{Binding Name}"/> </ContextMenu.ItemTemplate>
</HierarchicalDataTemplate> </ContextMenu>
</ContextMenu.ItemTemplate> </hc:DashedBorder.ContextMenu>
</ContextMenu> <TextBlock Foreground="{DynamicResource BorderBrush}" Style="{StaticResource TextBlockTitle}" TextAlignment="Center">
</Border.ContextMenu> <Run Text="{ex:Lang Key={x:Static langs:LangKeys.RightClickHere}}"/>
</Border> <LineBreak />
</hc:SimplePanel> <Run Text="Default" />
</TextBlock>
</hc:DashedBorder>
<hc:DashedBorder Width="200" Height="112" Background="Transparent" CornerRadius="4" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" BorderDashArray="2,2">
<hc:DashedBorder.ContextMenu>
<ContextMenu ItemsSource="{Binding DataList}" Style="{StaticResource ContextMenu.Small}">
<ContextMenu.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding DataList}">
<TextBlock Text="{Binding Name}" />
</HierarchicalDataTemplate>
</ContextMenu.ItemTemplate>
</ContextMenu>
</hc:DashedBorder.ContextMenu>
<TextBlock Foreground="{DynamicResource BorderBrush}" Style="{StaticResource TextBlockTitle}" TextAlignment="Center">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.RightClickHere}}" />
<LineBreak />
<Run Text="Small" />
</TextBlock>
</hc:DashedBorder>
</hc:UniformSpacingPanel>
</hc:TransitioningContentControl> </hc:TransitioningContentControl>
</UserControl> </UserControl>
@@ -0,0 +1,34 @@
using System.Windows;
using HandyControl.Data;
namespace HandyControl.Controls;
public class MenuAttach
{
public static readonly DependencyProperty PopupVerticalOffsetProperty = DependencyProperty.RegisterAttached(
"PopupVerticalOffset", typeof(double), typeof(MenuAttach), new PropertyMetadata(ValueBoxes.Double0Box));
public static void SetPopupVerticalOffset(DependencyObject element, double value)
=> element.SetValue(PopupVerticalOffsetProperty, value);
public static double GetPopupVerticalOffset(DependencyObject element)
=> (double) element.GetValue(PopupVerticalOffsetProperty);
public static readonly DependencyProperty PopupHorizontalOffsetProperty = DependencyProperty.RegisterAttached(
"PopupHorizontalOffset", typeof(double), typeof(MenuAttach), new PropertyMetadata(ValueBoxes.Double0Box));
public static void SetPopupHorizontalOffset(DependencyObject element, double value)
=> element.SetValue(PopupHorizontalOffsetProperty, value);
public static double GetPopupHorizontalOffset(DependencyObject element)
=> (double) element.GetValue(PopupHorizontalOffsetProperty);
public static readonly DependencyProperty ItemPaddingProperty = DependencyProperty.RegisterAttached(
"ItemPadding", typeof(Thickness), typeof(MenuAttach), new PropertyMetadata(default(Thickness)));
public static void SetItemPadding(DependencyObject element, Thickness value)
=> element.SetValue(ItemPaddingProperty, value);
public static Thickness GetItemPadding(DependencyObject element)
=> (Thickness) element.GetValue(ItemPaddingProperty);
}
@@ -20,6 +20,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\IconSwitchElement.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\IconSwitchElement.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\ImageAttach.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\ImageAttach.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\InfoElement.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\InfoElement.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\MenuAttach.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\MenuTopLineAttach.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\MenuTopLineAttach.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\PanelElement.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\PanelElement.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\PasswordBoxAttach.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\PasswordBoxAttach.cs" />
@@ -2,6 +2,9 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style x:Key="ContextMenuBaseStyle" TargetType="ContextMenu"> <Style x:Key="ContextMenuBaseStyle" TargetType="ContextMenu">
<Setter Property="hc:MenuAttach.ItemPadding" Value="{StaticResource DefaultControlPadding}" />
<Setter Property="hc:MenuAttach.PopupVerticalOffset" Value="-9" />
<Setter Property="hc:MenuAttach.PopupHorizontalOffset" Value="10" />
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/> <Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
<Setter Property="SnapsToDevicePixels" Value="True"/> <Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" /> <Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" />
@@ -3,8 +3,7 @@
xmlns:hc="clr-namespace:HandyControl.Controls"> xmlns:hc="clr-namespace:HandyControl.Controls">
<Style x:Key="MenuItemBaseStyle" TargetType="MenuItem"> <Style x:Key="MenuItemBaseStyle" TargetType="MenuItem">
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}"/> <Setter Property="Padding" Value="{Binding Path=(hc:MenuAttach.ItemPadding),RelativeSource={RelativeSource AncestorType=MenuBase}}"/>
<Setter Property="OverridesDefaultStyle" Value="True"/>
<Setter Property="Background" Value="Transparent"/> <Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/> <Setter Property="BorderThickness" Value="0"/>
<Setter Property="hc:ScrollViewer.PanningMode" Value="Both"/> <Setter Property="hc:ScrollViewer.PanningMode" Value="Both"/>
@@ -162,7 +161,7 @@
</Border> </Border>
<ContentPresenter TextElement.Foreground="{TemplateBinding Foreground}" Margin="0,3" x:Name="ContentPresenter" ContentTemplate="{TemplateBinding HeaderTemplate}" Grid.Column="1" ContentSource="Header" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/> <ContentPresenter TextElement.Foreground="{TemplateBinding Foreground}" Margin="0,3" x:Name="ContentPresenter" ContentTemplate="{TemplateBinding HeaderTemplate}" Grid.Column="1" ContentSource="Header" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
<Path x:Name="Path" Grid.Column="4" Width="10" Height="10" HorizontalAlignment="Left" Data="{StaticResource RightGeometry}" Stretch="Uniform" Fill="{TemplateBinding Foreground}" VerticalAlignment="Center"/> <Path x:Name="Path" Grid.Column="4" Width="10" Height="10" HorizontalAlignment="Left" Data="{StaticResource RightGeometry}" Stretch="Uniform" Fill="{TemplateBinding Foreground}" VerticalAlignment="Center"/>
<Popup Grid.Column="1" x:Name="PART_Popup" AllowsTransparency="True" Focusable="False" IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" VerticalOffset="-9" HorizontalOffset="10"> <Popup Grid.Column="1" x:Name="PART_Popup" AllowsTransparency="True" Focusable="False" IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" VerticalOffset="{Binding Path=(hc:MenuAttach.PopupVerticalOffset),RelativeSource={RelativeSource AncestorType=MenuBase}}" HorizontalOffset="{Binding Path=(hc:MenuAttach.PopupHorizontalOffset),RelativeSource={RelativeSource AncestorType=MenuBase}}">
<Border Effect="{StaticResource EffectShadow2}" Margin="8" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="SubMenuBorder" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}"> <Border Effect="{StaticResource EffectShadow2}" Margin="8" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="SubMenuBorder" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}">
<ScrollViewer Style="{StaticResource ScrollViewerUpDown}" Margin="2,2,2,0"> <ScrollViewer Style="{StaticResource ScrollViewerUpDown}" Margin="2,2,2,0">
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Cycle" Grid.IsSharedSizeScope="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.TabNavigation="Cycle"/> <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Cycle" Grid.IsSharedSizeScope="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.TabNavigation="Cycle"/>
@@ -190,11 +189,10 @@
</Style> </Style>
<Style x:Key="MenuBaseStyle" TargetType="Menu"> <Style x:Key="MenuBaseStyle" TargetType="Menu">
<Setter Property="OverridesDefaultStyle" Value="True"/> <Setter Property="hc:MenuAttach.ItemPadding" Value="{StaticResource DefaultControlPadding}" />
<Setter Property="hc:MenuAttach.PopupVerticalOffset" Value="-9" />
<Setter Property="hc:MenuAttach.PopupHorizontalOffset" Value="10" />
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/> <Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
<Setter Property="FontSize" Value="12"/>
<Setter Property="FontStyle" Value="Normal"/>
<Setter Property="FontWeight" Value="Normal"/>
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/> <Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
<Setter Property="VerticalContentAlignment" Value="Center"/> <Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" /> <Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" />
@@ -1,5 +1,12 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style BasedOn="{StaticResource ContextMenuBaseStyle}" TargetType="ContextMenu"/> <Style BasedOn="{StaticResource ContextMenuBaseStyle}" TargetType="ContextMenu"/>
<Style x:Key="ContextMenu.Small" BasedOn="{StaticResource ContextMenuBaseStyle}" TargetType="ContextMenu">
<Setter Property="hc:MenuAttach.ItemPadding" Value="6,0" />
<Setter Property="hc:MenuAttach.PopupVerticalOffset" Value="-3" />
<Setter Property="hc:MenuAttach.PopupHorizontalOffset" Value="6" />
</Style>
</ResourceDictionary> </ResourceDictionary>
@@ -1,7 +1,14 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style BasedOn="{StaticResource MenuItemBaseStyle}" TargetType="MenuItem" /> <Style BasedOn="{StaticResource MenuItemBaseStyle}" TargetType="MenuItem" />
<Style BasedOn="{StaticResource MenuBaseStyle}" TargetType="Menu" /> <Style BasedOn="{StaticResource MenuBaseStyle}" TargetType="Menu" />
<Style x:Key="Menu.Small" BasedOn="{StaticResource MenuBaseStyle}" TargetType="Menu">
<Setter Property="hc:MenuAttach.ItemPadding" Value="6,0" />
<Setter Property="hc:MenuAttach.PopupVerticalOffset" Value="-3" />
<Setter Property="hc:MenuAttach.PopupHorizontalOffset" Value="6" />
</Style>
</ResourceDictionary> </ResourceDictionary>
@@ -6511,8 +6511,7 @@
</Style.Triggers> </Style.Triggers>
</Style> </Style>
<Style x:Key="MenuItemBaseStyle" TargetType="MenuItem"> <Style x:Key="MenuItemBaseStyle" TargetType="MenuItem">
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}" /> <Setter Property="Padding" Value="{Binding Path=(hc:MenuAttach.ItemPadding),RelativeSource={RelativeSource AncestorType=MenuBase}}" />
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Background" Value="Transparent" /> <Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" /> <Setter Property="BorderThickness" Value="0" />
<Setter Property="hc:ScrollViewer.PanningMode" Value="Both" /> <Setter Property="hc:ScrollViewer.PanningMode" Value="Both" />
@@ -6670,7 +6669,7 @@
</Border> </Border>
<ContentPresenter TextElement.Foreground="{TemplateBinding Foreground}" Margin="0,3" x:Name="ContentPresenter" ContentTemplate="{TemplateBinding HeaderTemplate}" Grid.Column="1" ContentSource="Header" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> <ContentPresenter TextElement.Foreground="{TemplateBinding Foreground}" Margin="0,3" x:Name="ContentPresenter" ContentTemplate="{TemplateBinding HeaderTemplate}" Grid.Column="1" ContentSource="Header" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<Path x:Name="Path" Grid.Column="4" Width="10" Height="10" HorizontalAlignment="Left" Data="{StaticResource RightGeometry}" Stretch="Uniform" Fill="{TemplateBinding Foreground}" VerticalAlignment="Center" /> <Path x:Name="Path" Grid.Column="4" Width="10" Height="10" HorizontalAlignment="Left" Data="{StaticResource RightGeometry}" Stretch="Uniform" Fill="{TemplateBinding Foreground}" VerticalAlignment="Center" />
<Popup Grid.Column="1" x:Name="PART_Popup" AllowsTransparency="True" Focusable="False" IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" VerticalOffset="-9" HorizontalOffset="10"> <Popup Grid.Column="1" x:Name="PART_Popup" AllowsTransparency="True" Focusable="False" IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Right" VerticalOffset="{Binding Path=(hc:MenuAttach.PopupVerticalOffset),RelativeSource={RelativeSource AncestorType=MenuBase}}" HorizontalOffset="{Binding Path=(hc:MenuAttach.PopupHorizontalOffset),RelativeSource={RelativeSource AncestorType=MenuBase}}">
<Border Effect="{StaticResource EffectShadow2}" Margin="8" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="SubMenuBorder" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}"> <Border Effect="{StaticResource EffectShadow2}" Margin="8" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="SubMenuBorder" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}">
<ScrollViewer Style="{StaticResource ScrollViewerUpDown}" Margin="2,2,2,0"> <ScrollViewer Style="{StaticResource ScrollViewerUpDown}" Margin="2,2,2,0">
<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Cycle" Grid.IsSharedSizeScope="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.TabNavigation="Cycle" /> <ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Cycle" Grid.IsSharedSizeScope="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" KeyboardNavigation.TabNavigation="Cycle" />
@@ -6697,11 +6696,10 @@
</Style.Triggers> </Style.Triggers>
</Style> </Style>
<Style x:Key="MenuBaseStyle" TargetType="Menu"> <Style x:Key="MenuBaseStyle" TargetType="Menu">
<Setter Property="OverridesDefaultStyle" Value="True" /> <Setter Property="hc:MenuAttach.ItemPadding" Value="{StaticResource DefaultControlPadding}" />
<Setter Property="hc:MenuAttach.PopupVerticalOffset" Value="-9" />
<Setter Property="hc:MenuAttach.PopupHorizontalOffset" Value="10" />
<Setter Property="Background" Value="{DynamicResource RegionBrush}" /> <Setter Property="Background" Value="{DynamicResource RegionBrush}" />
<Setter Property="FontSize" Value="12" />
<Setter Property="FontStyle" Value="Normal" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" /> <Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
<Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" /> <Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" />
@@ -7203,6 +7201,11 @@
</Style> </Style>
<Style BasedOn="{StaticResource MenuItemBaseStyle}" TargetType="MenuItem" /> <Style BasedOn="{StaticResource MenuItemBaseStyle}" TargetType="MenuItem" />
<Style BasedOn="{StaticResource MenuBaseStyle}" TargetType="Menu" /> <Style BasedOn="{StaticResource MenuBaseStyle}" TargetType="Menu" />
<Style x:Key="Menu.Small" BasedOn="{StaticResource MenuBaseStyle}" TargetType="Menu">
<Setter Property="hc:MenuAttach.ItemPadding" Value="6,0" />
<Setter Property="hc:MenuAttach.PopupVerticalOffset" Value="-3" />
<Setter Property="hc:MenuAttach.PopupHorizontalOffset" Value="6" />
</Style>
<ControlTemplate x:Key="BadgeTextTemplate" TargetType="hc:Badge"> <ControlTemplate x:Key="BadgeTextTemplate" TargetType="hc:Badge">
<hc:SimplePanel> <hc:SimplePanel>
<ContentPresenter /> <ContentPresenter />
@@ -8205,6 +8208,9 @@
</Setter> </Setter>
</Style> </Style>
<Style x:Key="ContextMenuBaseStyle" TargetType="ContextMenu"> <Style x:Key="ContextMenuBaseStyle" TargetType="ContextMenu">
<Setter Property="hc:MenuAttach.ItemPadding" Value="{StaticResource DefaultControlPadding}" />
<Setter Property="hc:MenuAttach.PopupVerticalOffset" Value="-9" />
<Setter Property="hc:MenuAttach.PopupHorizontalOffset" Value="10" />
<Setter Property="Background" Value="{DynamicResource RegionBrush}" /> <Setter Property="Background" Value="{DynamicResource RegionBrush}" />
<Setter Property="SnapsToDevicePixels" Value="True" /> <Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" /> <Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" />
@@ -12727,6 +12733,11 @@
<Style TargetType="hc:ListClock" BasedOn="{StaticResource ListClockBaseStyle}" /> <Style TargetType="hc:ListClock" BasedOn="{StaticResource ListClockBaseStyle}" />
<Style BasedOn="{StaticResource ColorPickerBaseStyle}" TargetType="hc:ColorPicker" /> <Style BasedOn="{StaticResource ColorPickerBaseStyle}" TargetType="hc:ColorPicker" />
<Style BasedOn="{StaticResource ContextMenuBaseStyle}" TargetType="ContextMenu" /> <Style BasedOn="{StaticResource ContextMenuBaseStyle}" TargetType="ContextMenu" />
<Style x:Key="ContextMenu.Small" BasedOn="{StaticResource ContextMenuBaseStyle}" TargetType="ContextMenu">
<Setter Property="hc:MenuAttach.ItemPadding" Value="6,0" />
<Setter Property="hc:MenuAttach.PopupVerticalOffset" Value="-3" />
<Setter Property="hc:MenuAttach.PopupHorizontalOffset" Value="6" />
</Style>
<Style BasedOn="{StaticResource CoverFlowBaseStyle}" TargetType="hc:CoverFlow" /> <Style BasedOn="{StaticResource CoverFlowBaseStyle}" TargetType="hc:CoverFlow" />
<Style BasedOn="{StaticResource CoverViewBaseStyle}" TargetType="hc:CoverView" /> <Style BasedOn="{StaticResource CoverViewBaseStyle}" TargetType="hc:CoverView" />
<Style x:Key="DataGridBaseStyle" TargetType="DataGrid"> <Style x:Key="DataGridBaseStyle" TargetType="DataGrid">