|
|
|
@ -40,6 +40,7 @@ |
|
|
|
|
|
|
|
<Styles.Resources> |
|
|
|
<conv:PlatformKeyGestureConverter x:Key="KeyGestureConverter" /> |
|
|
|
<x:Double x:Key="MenuFlyoutSubItemPopupHorizontalOffset">-4</x:Double> |
|
|
|
<Thickness x:Key="MenuFlyoutScrollerMargin">0,4,0,4</Thickness> |
|
|
|
<Thickness x:Key="MenuIconPresenterMargin">0,0,12,0</Thickness> |
|
|
|
<Thickness x:Key="MenuInputGestureTextMargin">24,0,0,0</Thickness> |
|
|
|
@ -54,83 +55,85 @@ |
|
|
|
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" /> |
|
|
|
<Setter Property="Template"> |
|
|
|
<ControlTemplate> |
|
|
|
<Border Name="PART_LayoutRoot" |
|
|
|
Padding="{TemplateBinding Padding}" |
|
|
|
Background="{TemplateBinding Background}" |
|
|
|
BorderBrush="{TemplateBinding BorderBrush}" |
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"> |
|
|
|
<Grid> |
|
|
|
<Grid.ColumnDefinitions> |
|
|
|
<ColumnDefinition Width="Auto" |
|
|
|
SharedSizeGroup="MenuItemIcon" /> |
|
|
|
<ColumnDefinition Width="*" /> |
|
|
|
<ColumnDefinition Width="Auto" |
|
|
|
SharedSizeGroup="MenuItemIGT" /> |
|
|
|
<ColumnDefinition Width="Auto" |
|
|
|
SharedSizeGroup="MenuItemChevron" /> |
|
|
|
</Grid.ColumnDefinitions> |
|
|
|
<ContentPresenter Name="PART_IconPresenter" |
|
|
|
Content="{TemplateBinding Icon}" |
|
|
|
Width="16" |
|
|
|
Height="16" |
|
|
|
Margin="{DynamicResource MenuIconPresenterMargin}" |
|
|
|
HorizontalAlignment="Center" |
|
|
|
VerticalAlignment="Center"/> |
|
|
|
<Panel> |
|
|
|
<Border Name="PART_LayoutRoot" |
|
|
|
Padding="{TemplateBinding Padding}" |
|
|
|
Background="{TemplateBinding Background}" |
|
|
|
BorderBrush="{TemplateBinding BorderBrush}" |
|
|
|
BorderThickness="{TemplateBinding BorderThickness}"> |
|
|
|
<Grid> |
|
|
|
<Grid.ColumnDefinitions> |
|
|
|
<ColumnDefinition Width="Auto" |
|
|
|
SharedSizeGroup="MenuItemIcon" /> |
|
|
|
<ColumnDefinition Width="*" /> |
|
|
|
<ColumnDefinition Width="Auto" |
|
|
|
SharedSizeGroup="MenuItemIGT" /> |
|
|
|
<ColumnDefinition Width="Auto" |
|
|
|
SharedSizeGroup="MenuItemChevron" /> |
|
|
|
</Grid.ColumnDefinitions> |
|
|
|
<ContentPresenter Name="PART_IconPresenter" |
|
|
|
Content="{TemplateBinding Icon}" |
|
|
|
Width="16" |
|
|
|
Height="16" |
|
|
|
Margin="{DynamicResource MenuIconPresenterMargin}" |
|
|
|
HorizontalAlignment="Center" |
|
|
|
VerticalAlignment="Center" /> |
|
|
|
|
|
|
|
<ContentPresenter Name="PART_HeaderPresenter" |
|
|
|
Content="{TemplateBinding Header}" |
|
|
|
VerticalAlignment="Center" |
|
|
|
HorizontalAlignment="Stretch" |
|
|
|
TextBlock.Foreground="{TemplateBinding Foreground}" |
|
|
|
Grid.Column="1"> |
|
|
|
<ContentPresenter.DataTemplates> |
|
|
|
<DataTemplate DataType="sys:String"> |
|
|
|
<AccessText Text="{Binding}" /> |
|
|
|
</DataTemplate> |
|
|
|
</ContentPresenter.DataTemplates> |
|
|
|
</ContentPresenter> |
|
|
|
<TextBlock x:Name="PART_InputGestureText" |
|
|
|
Grid.Column="2" |
|
|
|
Classes="CaptionTextBlockStyle" |
|
|
|
Margin="{DynamicResource MenuInputGestureTextMargin}" |
|
|
|
Text="{TemplateBinding InputGesture, |
|
|
|
Converter={StaticResource KeyGestureConverter}}" |
|
|
|
HorizontalAlignment="Right" |
|
|
|
VerticalAlignment="Center" /> |
|
|
|
<Path Name="PART_ChevronPath" |
|
|
|
Stretch="Uniform" |
|
|
|
Width="8" |
|
|
|
Height="16" |
|
|
|
Data="{StaticResource MenuItemChevronPathData}" |
|
|
|
Margin="{DynamicResource MenuFlyoutItemChevronMargin}" |
|
|
|
VerticalAlignment="Center" |
|
|
|
Grid.Column="3" /> |
|
|
|
<Popup Name="PART_Popup" |
|
|
|
WindowManagerAddShadowHint="True" |
|
|
|
PlacementMode="Right" |
|
|
|
StaysOpen="True" |
|
|
|
IsOpen="{TemplateBinding IsSubMenuOpen, |
|
|
|
Mode=TwoWay}"> |
|
|
|
<Border Background="{DynamicResource MenuFlyoutPresenterBackground}" |
|
|
|
BorderBrush="{DynamicResource MenuFlyoutPresenterBorderBrush}" |
|
|
|
BorderThickness="{DynamicResource MenuFlyoutPresenterBorderThemeThickness}" |
|
|
|
Padding="{DynamicResource MenuFlyoutPresenterThemePadding}" |
|
|
|
MaxWidth="{DynamicResource FlyoutThemeMaxWidth}" |
|
|
|
MinHeight="{DynamicResource MenuFlyoutThemeMinHeight}" |
|
|
|
HorizontalAlignment="Stretch" |
|
|
|
CornerRadius="{DynamicResource OverlayCornerRadius}"> |
|
|
|
<ScrollViewer> |
|
|
|
<ItemsPresenter Name="PART_ItemsPresenter" |
|
|
|
Items="{TemplateBinding Items}" |
|
|
|
ItemsPanel="{TemplateBinding ItemsPanel}" |
|
|
|
ItemTemplate="{TemplateBinding ItemTemplate}" |
|
|
|
Margin="{DynamicResource MenuFlyoutScrollerMargin}" |
|
|
|
Grid.IsSharedSizeScope="True" /> |
|
|
|
</ScrollViewer> |
|
|
|
</Border> |
|
|
|
</Popup> |
|
|
|
</Grid> |
|
|
|
</Border> |
|
|
|
<ContentPresenter Name="PART_HeaderPresenter" |
|
|
|
Content="{TemplateBinding Header}" |
|
|
|
VerticalAlignment="Center" |
|
|
|
HorizontalAlignment="Stretch" |
|
|
|
TextBlock.Foreground="{TemplateBinding Foreground}" |
|
|
|
Grid.Column="1"> |
|
|
|
<ContentPresenter.DataTemplates> |
|
|
|
<DataTemplate DataType="sys:String"> |
|
|
|
<AccessText Text="{Binding}" /> |
|
|
|
</DataTemplate> |
|
|
|
</ContentPresenter.DataTemplates> |
|
|
|
</ContentPresenter> |
|
|
|
<TextBlock x:Name="PART_InputGestureText" |
|
|
|
Grid.Column="2" |
|
|
|
Classes="CaptionTextBlockStyle" |
|
|
|
Margin="{DynamicResource MenuInputGestureTextMargin}" |
|
|
|
Text="{TemplateBinding InputGesture, Converter={StaticResource KeyGestureConverter}}" |
|
|
|
HorizontalAlignment="Right" |
|
|
|
VerticalAlignment="Center" /> |
|
|
|
<Path Name="PART_ChevronPath" |
|
|
|
Stretch="Uniform" |
|
|
|
Width="8" |
|
|
|
Height="16" |
|
|
|
Data="{StaticResource MenuItemChevronPathData}" |
|
|
|
Margin="{DynamicResource MenuFlyoutItemChevronMargin}" |
|
|
|
VerticalAlignment="Center" |
|
|
|
Grid.Column="3" /> |
|
|
|
</Grid> |
|
|
|
</Border> |
|
|
|
<Popup Name="PART_Popup" |
|
|
|
WindowManagerAddShadowHint="True" |
|
|
|
PlacementMode="Right" |
|
|
|
HorizontalOffset="{StaticResource MenuFlyoutSubItemPopupHorizontalOffset}" |
|
|
|
StaysOpen="True" |
|
|
|
IsOpen="{TemplateBinding IsSubMenuOpen, |
|
|
|
Mode=TwoWay}"> |
|
|
|
<Border Background="{DynamicResource MenuFlyoutPresenterBackground}" |
|
|
|
BorderBrush="{DynamicResource MenuFlyoutPresenterBorderBrush}" |
|
|
|
BorderThickness="{DynamicResource MenuFlyoutPresenterBorderThemeThickness}" |
|
|
|
Padding="{DynamicResource MenuFlyoutPresenterThemePadding}" |
|
|
|
MaxWidth="{DynamicResource FlyoutThemeMaxWidth}" |
|
|
|
MinHeight="{DynamicResource MenuFlyoutThemeMinHeight}" |
|
|
|
HorizontalAlignment="Stretch" |
|
|
|
CornerRadius="{DynamicResource OverlayCornerRadius}"> |
|
|
|
<ScrollViewer> |
|
|
|
<ItemsPresenter Name="PART_ItemsPresenter" |
|
|
|
Items="{TemplateBinding Items}" |
|
|
|
ItemsPanel="{TemplateBinding ItemsPanel}" |
|
|
|
ItemTemplate="{TemplateBinding ItemTemplate}" |
|
|
|
Margin="{DynamicResource MenuFlyoutScrollerMargin}" |
|
|
|
Grid.IsSharedSizeScope="True" /> |
|
|
|
</ScrollViewer> |
|
|
|
</Border> |
|
|
|
</Popup> |
|
|
|
</Panel> |
|
|
|
</ControlTemplate> |
|
|
|
</Setter> |
|
|
|
</Style> |
|
|
|
|