|
|
@@ -25,11 +25,12 @@
|
|
|
</MenuItem>
|
|
|
<MenuItem Header="Edit">
|
|
|
<MenuItem Header="Go To">
|
|
|
- <MenuItem Header="Go To Line"/>
|
|
|
+ <MenuItem Header="Go To Line" />
|
|
|
</MenuItem>
|
|
|
</MenuItem>
|
|
|
<MenuItem Header="View">
|
|
|
- <MenuItem Header="Designer" InputGesture="Shift+F7" />
|
|
|
+ <MenuItem Header="Designer"
|
|
|
+ InputGesture="Shift+F7" />
|
|
|
</MenuItem>
|
|
|
<MenuItem Header="Project">
|
|
|
<MenuItem Header="Add class" />
|
|
|
@@ -40,9 +41,10 @@
|
|
|
|
|
|
<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>
|
|
|
+ <Thickness x:Key="MenuInputGestureTextMargin">24,0,0,0</Thickness>
|
|
|
<StreamGeometry x:Key="MenuItemChevronPathData">M 1,0 10,10 l -9,10 -1,-1 L 8,10 -0,1 Z</StreamGeometry>
|
|
|
</Styles.Resources>
|
|
|
|
|
|
@@ -54,83 +56,84 @@
|
|
|
<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>
|
|
|
@@ -145,6 +148,8 @@
|
|
|
<Panel>
|
|
|
<ContentPresenter Name="PART_HeaderPresenter"
|
|
|
Content="{TemplateBinding Header}"
|
|
|
+ VerticalAlignment="Center"
|
|
|
+ HorizontalAlignment="Stretch"
|
|
|
Margin="{TemplateBinding Padding}">
|
|
|
<ContentPresenter.DataTemplates>
|
|
|
<DataTemplate DataType="sys:String">
|
|
|
@@ -155,8 +160,7 @@
|
|
|
<Popup Name="PART_Popup"
|
|
|
WindowManagerAddShadowHint="False"
|
|
|
MinWidth="{Binding Bounds.Width, RelativeSource={RelativeSource TemplatedParent}}"
|
|
|
- IsOpen="{TemplateBinding IsSubMenuOpen,
|
|
|
- Mode=TwoWay}"
|
|
|
+ IsOpen="{TemplateBinding IsSubMenuOpen, Mode=TwoWay}"
|
|
|
StaysOpen="True">
|
|
|
<Border Background="{DynamicResource MenuFlyoutPresenterBackground}"
|
|
|
BorderBrush="{DynamicResource MenuFlyoutPresenterBorderBrush}"
|
|
|
@@ -183,10 +187,15 @@
|
|
|
</Style>
|
|
|
|
|
|
<Style Selector="MenuItem">
|
|
|
- <!-- Narrow padding should be used for mouse input, when non-narrow one should be used for touch input in future. -->
|
|
|
- <Setter Property="Padding" Value="{DynamicResource MenuFlyoutItemThemePaddingNarrow}" />
|
|
|
+ <!-- Narrow padding should be used for mouse input, when non-narrow one should be used for touch input in future. -->
|
|
|
+ <Setter Property="Padding" Value="{StaticResource MenuFlyoutItemThemePaddingNarrow}" />
|
|
|
</Style>
|
|
|
-
|
|
|
+
|
|
|
+ <Style Selector="Menu > MenuItem">
|
|
|
+ <!-- Custom padding for Menu > MenuItem -->
|
|
|
+ <Setter Property="Padding" Value="{StaticResource MenuBarItemPadding}" />
|
|
|
+ </Style>
|
|
|
+
|
|
|
<Style Selector="MenuItem /template/ ContentPresenter#PART_IconPresenter">
|
|
|
<Setter Property="IsVisible" Value="False" />
|
|
|
</Style>
|
|
|
@@ -212,14 +221,15 @@
|
|
|
<Setter Property="Fill" Value="{DynamicResource MenuFlyoutSubItemChevronPointerOver}" />
|
|
|
</Style>
|
|
|
|
|
|
- <Style Selector="MenuItem:pressed /template/ Border#PART_LayoutRoot">
|
|
|
+ <!-- Listen for PART_LayoutRoot:pointerover, so it will not be triggered when subitem is pressed -->
|
|
|
+ <Style Selector="MenuItem:pressed /template/ Border#PART_LayoutRoot:pointerover">
|
|
|
<Setter Property="Background" Value="{DynamicResource MenuFlyoutItemBackgroundPressed}" />
|
|
|
<Setter Property="BorderBrush" Value="{DynamicResource MenuFlyoutItemBorderBrushPressed}" />
|
|
|
</Style>
|
|
|
- <Style Selector="MenuItem:pressed /template/ TextBlock#PART_InputGestureText">
|
|
|
+ <Style Selector="MenuItem:pressed /template/ Border#PART_LayoutRoot:pointerover TextBlock#PART_InputGestureText">
|
|
|
<Setter Property="Foreground" Value="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForegroundPressed}" />
|
|
|
</Style>
|
|
|
- <Style Selector="MenuItem:pressed /template/ Path#PART_ChevronPath">
|
|
|
+ <Style Selector="MenuItem:pressed /template/ Border#PART_LayoutRoot:pointerover Path#PART_ChevronPath">
|
|
|
<Setter Property="Fill" Value="{DynamicResource MenuFlyoutSubItemChevronPressed}" />
|
|
|
</Style>
|
|
|
|