570 lines
30 KiB
XML
570 lines
30 KiB
XML
<ResourceDictionary
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
mc:Ignorable="d">
|
|
|
|
<Geometry x:Key="UpArrow">M 0,4 L 3.5,0 L 7,4 Z</Geometry>
|
|
|
|
<MenuScrollingVisibilityConverter x:Key="MenuScrollingVisibilityConverter" />
|
|
|
|
<Geometry x:Key="DownArrow">M 0,0 L 3.5,4 L 7,0 Z</Geometry>
|
|
|
|
<Style
|
|
x:Key="MenuScrollButton"
|
|
BasedOn="{x:Null}"
|
|
TargetType="{x:Type RepeatButton}">
|
|
<Setter Property="ClickMode" Value="Hover" />
|
|
<Setter Property="MinWidth" Value="0" />
|
|
<Setter Property="MinHeight" Value="0" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type RepeatButton}">
|
|
<DockPanel Background="Transparent" SnapsToDevicePixels="true">
|
|
<Rectangle
|
|
x:Name="R1"
|
|
Width="1"
|
|
DockPanel.Dock="Right"
|
|
Fill="Transparent" />
|
|
<Rectangle
|
|
x:Name="B1"
|
|
Height="1"
|
|
DockPanel.Dock="Bottom"
|
|
Fill="Transparent" />
|
|
<Rectangle
|
|
x:Name="L1"
|
|
Width="1"
|
|
DockPanel.Dock="Left"
|
|
Fill="Transparent" />
|
|
<Rectangle
|
|
x:Name="T1"
|
|
Height="1"
|
|
DockPanel.Dock="Top"
|
|
Fill="Transparent" />
|
|
<ContentPresenter
|
|
x:Name="ContentContainer"
|
|
Margin="2,2,2,2"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center" />
|
|
</DockPanel>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsPressed" Value="true">
|
|
<Setter TargetName="R1" Property="Fill" Value="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}" />
|
|
<Setter TargetName="B1" Property="Fill" Value="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}" />
|
|
<Setter TargetName="L1" Property="Fill" Value="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" />
|
|
<Setter TargetName="T1" Property="Fill" Value="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}" />
|
|
<Setter TargetName="ContentContainer" Property="Margin" Value="3,3,1,1" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<Style
|
|
x:Key="{ComponentResourceKey ResourceId=MenuScrollViewer,
|
|
TypeInTargetAssembly={x:Type FrameworkElement}}"
|
|
BasedOn="{x:Null}"
|
|
TargetType="{x:Type ScrollViewer}">
|
|
<Setter Property="HorizontalScrollBarVisibility" Value="Hidden" />
|
|
<Setter Property="VerticalScrollBarVisibility" Value="Auto" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type ScrollViewer}">
|
|
<Grid SnapsToDevicePixels="true">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*" />
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
<RowDefinition Height="Auto" />
|
|
</Grid.RowDefinitions>
|
|
<Border Grid.Row="1" Grid.Column="0">
|
|
<ScrollContentPresenter Margin="{TemplateBinding Padding}" />
|
|
</Border>
|
|
<RepeatButton
|
|
Grid.Row="0"
|
|
Grid.Column="0"
|
|
Command="{x:Static ScrollBar.LineUpCommand}"
|
|
CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
|
|
Focusable="false"
|
|
Style="{StaticResource MenuScrollButton}">
|
|
<RepeatButton.Visibility>
|
|
<MultiBinding
|
|
Converter="{StaticResource MenuScrollingVisibilityConverter}"
|
|
ConverterParameter="0"
|
|
FallbackValue="Visibility.Collapsed">
|
|
<Binding Path="ComputedVerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}" />
|
|
<Binding Path="VerticalOffset" RelativeSource="{RelativeSource TemplatedParent}" />
|
|
<Binding Path="ExtentHeight" RelativeSource="{RelativeSource TemplatedParent}" />
|
|
<Binding Path="ViewportHeight" RelativeSource="{RelativeSource TemplatedParent}" />
|
|
</MultiBinding>
|
|
</RepeatButton.Visibility>
|
|
<Path Data="{StaticResource UpArrow}" Fill="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}" />
|
|
</RepeatButton>
|
|
<RepeatButton
|
|
Grid.Row="2"
|
|
Grid.Column="0"
|
|
Command="{x:Static ScrollBar.LineDownCommand}"
|
|
CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}"
|
|
Focusable="false"
|
|
Style="{StaticResource MenuScrollButton}">
|
|
<RepeatButton.Visibility>
|
|
<MultiBinding
|
|
Converter="{StaticResource MenuScrollingVisibilityConverter}"
|
|
ConverterParameter="100"
|
|
FallbackValue="Visibility.Collapsed">
|
|
<Binding Path="ComputedVerticalScrollBarVisibility" RelativeSource="{RelativeSource TemplatedParent}" />
|
|
<Binding Path="VerticalOffset" RelativeSource="{RelativeSource TemplatedParent}" />
|
|
<Binding Path="ExtentHeight" RelativeSource="{RelativeSource TemplatedParent}" />
|
|
<Binding Path="ViewportHeight" RelativeSource="{RelativeSource TemplatedParent}" />
|
|
</MultiBinding>
|
|
</RepeatButton.Visibility>
|
|
<Path Data="{StaticResource DownArrow}" Fill="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}" />
|
|
</RepeatButton>
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
<ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuContent, TypeInTargetAssembly={x:Type FrameworkElement}}" TargetType="{x:Type ContentControl}">
|
|
<Border
|
|
MinWidth="{TemplateBinding ActualWidth}"
|
|
Padding="5,0"
|
|
Background="{DynamicResource Color_BG_SubMenuBG}"
|
|
BorderBrush="{DynamicResource Color_BD_SubMenu}"
|
|
BorderThickness="1"
|
|
SnapsToDevicePixels="True">
|
|
<ContentPresenter Margin="0,5" HorizontalAlignment="Left" />
|
|
</Border>
|
|
</ControlTemplate>
|
|
|
|
<ControlTemplate x:Key="{ComponentResourceKey ResourceId=TopLevelHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
|
|
<ControlTemplate.Resources>
|
|
<Storyboard x:Key="OnMouseOver">
|
|
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
|
|
<EasingDoubleKeyFrame KeyTime="0" Value="0" />
|
|
<SplineDoubleKeyFrame
|
|
KeySpline="0,0,1,0"
|
|
KeyTime="0:0:0.2"
|
|
Value="1" />
|
|
</DoubleAnimationUsingKeyFrames>
|
|
</Storyboard>
|
|
<Storyboard x:Key="OnMouseOut">
|
|
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="Highlight" Storyboard.TargetProperty="(UIElement.Opacity)">
|
|
<EasingDoubleKeyFrame KeyTime="0" Value="1" />
|
|
<SplineDoubleKeyFrame
|
|
KeySpline="0,0,0,1"
|
|
KeyTime="0:0:0.2"
|
|
Value="0" />
|
|
</DoubleAnimationUsingKeyFrames>
|
|
</Storyboard>
|
|
</ControlTemplate.Resources>
|
|
<Grid SnapsToDevicePixels="true">
|
|
<Border
|
|
x:Name="BG"
|
|
Background="{DynamicResource Color_BG_Menu}"
|
|
BorderBrush="{DynamicResource Color_BD_Menu}"
|
|
BorderThickness="1"
|
|
Cursor="Hand">
|
|
<Border.Effect>
|
|
<DropShadowEffect
|
|
BlurRadius="10"
|
|
ShadowDepth="0"
|
|
Color="#FFC6E9FF" />
|
|
</Border.Effect>
|
|
<Grid>
|
|
<Border
|
|
x:Name="Highlight"
|
|
Background="{DynamicResource Color_BG_Menu_Highlight}"
|
|
Opacity="0">
|
|
<Border.Effect>
|
|
<BlurEffect />
|
|
</Border.Effect>
|
|
</Border>
|
|
</Grid>
|
|
</Border>
|
|
<ContentPresenter
|
|
x:Name="contentPresenter"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
ContentSource="Header"
|
|
Cursor="Hand"
|
|
RecognizesAccessKey="True"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
|
<Popup
|
|
x:Name="PART_Popup"
|
|
Grid.Column="1"
|
|
MinWidth="150"
|
|
AllowsTransparency="true"
|
|
Focusable="false"
|
|
HorizontalOffset="1"
|
|
IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}"
|
|
Placement="Bottom"
|
|
PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}"
|
|
VerticalOffset="2">
|
|
<ContentControl
|
|
x:Name="SubMenuBorder"
|
|
IsTabStop="false"
|
|
Template="{DynamicResource {ComponentResourceKey ResourceId=SubmenuContent,
|
|
TypeInTargetAssembly={x:Type FrameworkElement}}}">
|
|
<ScrollViewer CanContentScroll="true" Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}">
|
|
<ItemsPresenter
|
|
Margin="2"
|
|
Cursor="Hand"
|
|
Grid.IsSharedSizeScope="true"
|
|
KeyboardNavigation.DirectionalNavigation="Cycle"
|
|
KeyboardNavigation.TabNavigation="Cycle"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
|
</ScrollViewer>
|
|
</ContentControl>
|
|
</Popup>
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsSuspendingPopupAnimation" Value="true">
|
|
<Setter TargetName="PART_Popup" Property="PopupAnimation" Value="None" />
|
|
</Trigger>
|
|
<Trigger Property="Icon" Value="{x:Null}" />
|
|
<Trigger Property="IsChecked" Value="true" />
|
|
<Trigger SourceName="PART_Popup" Property="HasDropShadow" Value="true" />
|
|
<Trigger Property="IsHighlighted" Value="true">
|
|
<Trigger.ExitActions>
|
|
<BeginStoryboard x:Name="OnMouseOut_BeginStoryboard1" Storyboard="{StaticResource OnMouseOut}" />
|
|
</Trigger.ExitActions>
|
|
<Trigger.EnterActions>
|
|
<BeginStoryboard x:Name="OnMouseOver_BeginStoryboard" Storyboard="{StaticResource OnMouseOver}" />
|
|
</Trigger.EnterActions>
|
|
</Trigger>
|
|
<DataTrigger Binding="{Binding Selected}" Value="True">
|
|
<Setter TargetName="Highlight" Property="Opacity" Value="1" />
|
|
</DataTrigger>
|
|
<Trigger Property="IsKeyboardFocused" Value="true" />
|
|
<Trigger Property="IsSubmenuOpen" Value="true" />
|
|
<Trigger Property="IsEnabled" Value="false">
|
|
<Setter Property="Foreground" Value="#FF9A9A9A" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
|
|
<SolidColorBrush x:Key="Menu_Main_BD" Color="#FF043963" />
|
|
<SolidColorBrush x:Key="Menu_Main_BG" Color="#FF3d8d73" />
|
|
<SolidColorBrush x:Key="Menu_Main_BG_Highlight" Color="#FFd1e3cf" />
|
|
<SolidColorBrush x:Key="Menu_Main_BG_Outer" Color="#FFCACACA" />
|
|
<SolidColorBrush x:Key="Menu_Main_BG_Outer_Red" Color="#FFFF0000" />
|
|
<SolidColorBrush x:Key="Menu_Main_BD_Highlight" Color="#FFd1e3cf" />
|
|
<SolidColorBrush x:Key="Menu_Main_BD_Shadow" Color="#FF111A2B" />
|
|
<SolidColorBrush x:Key="Menu_Main_BG_Inner" Color="#FF346294" />
|
|
<SolidColorBrush x:Key="Menu_Main_BG_Outer_Highlight" Color="#FFd1e3cf" />
|
|
<SolidColorBrush x:Key="Menu_Main_BG_Inner_Highlight" Color="#FF1A2730" />
|
|
|
|
<ControlTemplate x:Key="SubMunu_ShowOnTop" TargetType="{x:Type MenuItem}">
|
|
<Grid x:Name="MainBG" SnapsToDevicePixels="true">
|
|
<Border
|
|
Background="{DynamicResource Menu_Main_BG_Outer}"
|
|
BorderBrush="{DynamicResource Menu_Main_BD}"
|
|
BorderThickness="1"
|
|
CornerRadius="5">
|
|
<Grid>
|
|
<Rectangle
|
|
x:Name="InnerBG"
|
|
Height="10"
|
|
VerticalAlignment="Center"
|
|
Fill="{DynamicResource Menu_Main_BG_Inner}" />
|
|
<Border
|
|
x:Name="BG"
|
|
Margin="2"
|
|
Background="{DynamicResource Menu_Main_BG}"
|
|
CornerRadius="3">
|
|
<ContentPresenter
|
|
x:Name="contentPresenter"
|
|
Margin="5,0"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
ContentSource="Header"
|
|
Cursor="Hand"
|
|
RecognizesAccessKey="True"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
|
</Border>
|
|
</Grid>
|
|
</Border>
|
|
<Popup
|
|
x:Name="PART_Popup"
|
|
Grid.Column="1"
|
|
MinWidth="150"
|
|
AllowsTransparency="true"
|
|
Focusable="false"
|
|
HorizontalOffset="0"
|
|
IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}"
|
|
Placement="Top"
|
|
PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}"
|
|
VerticalOffset="-2">
|
|
<ContentControl
|
|
x:Name="SubMenuBorder"
|
|
IsTabStop="false"
|
|
Template="{DynamicResource {ComponentResourceKey ResourceId=SubmenuContent,
|
|
TypeInTargetAssembly={x:Type FrameworkElement}}}">
|
|
<ScrollViewer CanContentScroll="true" Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}">
|
|
<ItemsPresenter
|
|
Margin="2"
|
|
Cursor="Hand"
|
|
Grid.IsSharedSizeScope="true"
|
|
KeyboardNavigation.DirectionalNavigation="Cycle"
|
|
KeyboardNavigation.TabNavigation="Cycle"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
|
</ScrollViewer>
|
|
</ContentControl>
|
|
</Popup>
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsSuspendingPopupAnimation" Value="true">
|
|
<Setter TargetName="PART_Popup" Property="PopupAnimation" Value="None" />
|
|
</Trigger>
|
|
<Trigger Property="Icon" Value="{x:Null}" />
|
|
<Trigger Property="IsChecked" Value="true" />
|
|
<Trigger SourceName="PART_Popup" Property="HasDropShadow" Value="true" />
|
|
<Trigger Property="IsHighlighted" Value="true">
|
|
<Setter TargetName="BG" Property="Background" Value="{DynamicResource Menu_Main_BG_Highlight}" />
|
|
<Setter TargetName="InnerBG" Property="Fill" Value="{DynamicResource Menu_Main_BG_Highlight}" />
|
|
</Trigger>
|
|
<DataTrigger Binding="{Binding Selected}" Value="True">
|
|
<Setter Property="Foreground" Value="{DynamicResource FG_Black}" />
|
|
<Setter TargetName="BG" Property="Background" Value="{DynamicResource Menu_Main_BG_Highlight}" />
|
|
<Setter TargetName="InnerBG" Property="Fill" Value="{DynamicResource Menu_Main_BG_Inner_Highlight}" />
|
|
<Setter TargetName="BG" Property="Margin" Value="3" />
|
|
<Setter TargetName="MainBG" Property="Margin" Value="-3" />
|
|
</DataTrigger>
|
|
<Trigger Property="IsKeyboardFocused" Value="true" />
|
|
<Trigger Property="IsSubmenuOpen" Value="true" />
|
|
<Trigger Property="IsEnabled" Value="false">
|
|
<Setter Property="Foreground" Value="#FF9A9A9A" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
|
|
<ControlTemplate x:Key="SubMunu_ShowOnTop_Red" TargetType="{x:Type MenuItem}">
|
|
<Grid x:Name="MainBG" SnapsToDevicePixels="true">
|
|
<Border
|
|
Background="{DynamicResource Menu_Main_BG_Outer_Red}"
|
|
BorderBrush="{DynamicResource Menu_Main_BD}"
|
|
BorderThickness="1"
|
|
CornerRadius="5">
|
|
<Grid>
|
|
<Rectangle
|
|
x:Name="InnerBG"
|
|
Height="10"
|
|
VerticalAlignment="Center"
|
|
Fill="{DynamicResource Menu_Main_BG_Inner}" />
|
|
<Border
|
|
x:Name="BG"
|
|
Margin="2"
|
|
Background="{DynamicResource Menu_Main_BG}"
|
|
CornerRadius="3">
|
|
<ContentPresenter
|
|
x:Name="contentPresenter"
|
|
Margin="5,0"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
ContentSource="Header"
|
|
Cursor="Hand"
|
|
RecognizesAccessKey="True"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
|
</Border>
|
|
</Grid>
|
|
</Border>
|
|
<Popup
|
|
x:Name="PART_Popup"
|
|
Grid.Column="1"
|
|
MinWidth="150"
|
|
AllowsTransparency="true"
|
|
Focusable="false"
|
|
HorizontalOffset="0"
|
|
IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}"
|
|
Placement="Top"
|
|
PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}"
|
|
VerticalOffset="-2">
|
|
<ContentControl
|
|
x:Name="SubMenuBorder"
|
|
IsTabStop="false"
|
|
Template="{DynamicResource {ComponentResourceKey ResourceId=SubmenuContent,
|
|
TypeInTargetAssembly={x:Type FrameworkElement}}}">
|
|
<ScrollViewer CanContentScroll="true" Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}">
|
|
<ItemsPresenter
|
|
Margin="2"
|
|
Cursor="Hand"
|
|
Grid.IsSharedSizeScope="true"
|
|
KeyboardNavigation.DirectionalNavigation="Cycle"
|
|
KeyboardNavigation.TabNavigation="Cycle"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
|
</ScrollViewer>
|
|
</ContentControl>
|
|
</Popup>
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<Trigger Property="IsSuspendingPopupAnimation" Value="true">
|
|
<Setter TargetName="PART_Popup" Property="PopupAnimation" Value="None" />
|
|
</Trigger>
|
|
<Trigger Property="Icon" Value="{x:Null}" />
|
|
<Trigger Property="IsChecked" Value="true" />
|
|
<Trigger SourceName="PART_Popup" Property="HasDropShadow" Value="true" />
|
|
<Trigger Property="IsHighlighted" Value="true">
|
|
<Setter TargetName="BG" Property="Background" Value="{DynamicResource Menu_Main_BG_Highlight}" />
|
|
<Setter TargetName="InnerBG" Property="Fill" Value="{DynamicResource Menu_Main_BG_Highlight}" />
|
|
</Trigger>
|
|
<DataTrigger Binding="{Binding Selected}" Value="True">
|
|
<Setter Property="Foreground" Value="{DynamicResource FG_Black}" />
|
|
<Setter TargetName="BG" Property="Background" Value="{DynamicResource Menu_Main_BG_Highlight}" />
|
|
<Setter TargetName="InnerBG" Property="Fill" Value="{DynamicResource Menu_Main_BG_Inner_Highlight}" />
|
|
<Setter TargetName="BG" Property="Margin" Value="3" />
|
|
<Setter TargetName="MainBG" Property="Margin" Value="-3" />
|
|
</DataTrigger>
|
|
<Trigger Property="IsKeyboardFocused" Value="true" />
|
|
<Trigger Property="IsSubmenuOpen" Value="true" />
|
|
<Trigger Property="IsEnabled" Value="false">
|
|
<Setter Property="Foreground" Value="#FF9A9A9A" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
|
|
<ControlTemplate x:Key="SubMenu_ShowOnBottom" TargetType="{x:Type MenuItem}">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="10" />
|
|
<ColumnDefinition />
|
|
<ColumnDefinition Width="10" />
|
|
</Grid.ColumnDefinitions>
|
|
<Path
|
|
x:Name="Left_Part"
|
|
Margin="0,0,-3,0"
|
|
Data="M11.5,34.5 L10,34.5 0.5,0.5 11.5,0.5"
|
|
Fill="{DynamicResource SubMenu_BG}"
|
|
Stretch="Fill"
|
|
Stroke="{DynamicResource SubMenu_BD_Shadow}" />
|
|
<Path
|
|
x:Name="Right_Part"
|
|
Grid.Column="2"
|
|
Margin="-3,0,0,0"
|
|
Data="M11.5,34.5 L10,34.5 0.5,0.5 11.5,0.5"
|
|
Fill="{DynamicResource SubMenu_BG}"
|
|
RenderTransformOrigin="0.5,0.5"
|
|
Stretch="Fill"
|
|
Stroke="{DynamicResource SubMenu_BD_Shadow}">
|
|
<Path.RenderTransform>
|
|
<TransformGroup>
|
|
<ScaleTransform ScaleX="-1" ScaleY="1" />
|
|
<SkewTransform AngleX="0" AngleY="0" />
|
|
<RotateTransform Angle="0" />
|
|
<TranslateTransform />
|
|
</TransformGroup>
|
|
</Path.RenderTransform>
|
|
</Path>
|
|
<Border
|
|
x:Name="BG"
|
|
Grid.Column="1"
|
|
Background="{DynamicResource SubMenu_BG}"
|
|
BorderBrush="{DynamicResource SubMenu_BD_Shadow}"
|
|
BorderThickness="0,1"
|
|
Cursor="Hand">
|
|
<ContentPresenter
|
|
x:Name="contentPresenter"
|
|
Margin="6,0"
|
|
HorizontalAlignment="Center"
|
|
VerticalAlignment="Center"
|
|
ContentSource="Header"
|
|
Cursor="Hand"
|
|
RecognizesAccessKey="True"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
|
</Border>
|
|
<Rectangle
|
|
x:Name="Top_Highlight"
|
|
Grid.ColumnSpan="3"
|
|
Height="1"
|
|
Margin="1,1"
|
|
VerticalAlignment="Top"
|
|
Fill="{DynamicResource SubMenu_BD_Highlight}" />
|
|
<Rectangle
|
|
x:Name="Bottom_Shadow"
|
|
Grid.Column="1"
|
|
Height="1"
|
|
Margin="1,1"
|
|
VerticalAlignment="Bottom"
|
|
Fill="{DynamicResource SubMenu_BD_Shadow}" />
|
|
<Path
|
|
x:Name="Left_Highlight"
|
|
Margin="1,1,-2.5,1"
|
|
Data="M0,0 L1,0 11.5,35 10.5,35 z"
|
|
Fill="{DynamicResource SubMenu_BD_Highlight}"
|
|
Stretch="Fill" />
|
|
<Path
|
|
x:Name="Right_Shadow"
|
|
Grid.Column="2"
|
|
Margin="-2.5,1,1,1"
|
|
Data="M0,0 L1,0 -9.5,33 -10.5,33 z"
|
|
Fill="{DynamicResource SubMenu_BD_Shadow}"
|
|
Stretch="Fill" />
|
|
</Grid>
|
|
<ControlTemplate.Triggers>
|
|
<DataTrigger Binding="{Binding Selected}" Value="True">
|
|
<Setter Property="Panel.ZIndex" Value="100" />
|
|
<Setter TargetName="BG" Property="Background" Value="{DynamicResource SubMenu_BG_Select}" />
|
|
<Setter TargetName="BG" Property="BorderBrush" Value="{DynamicResource SubMenu_BD_Shadow_Select}" />
|
|
<Setter TargetName="Left_Part" Property="Fill" Value="{DynamicResource SubMenu_BG_Select}" />
|
|
<Setter TargetName="Left_Part" Property="Stroke" Value="{DynamicResource SubMenu_BD_Shadow_Select}" />
|
|
<Setter TargetName="Right_Part" Property="Fill" Value="{DynamicResource SubMenu_BG_Select}" />
|
|
<Setter TargetName="Right_Part" Property="Stroke" Value="{DynamicResource SubMenu_BD_Shadow_Select}" />
|
|
<Setter TargetName="Top_Highlight" Property="Fill" Value="{DynamicResource SubMenu_BD_Shadow_Highlight}" />
|
|
<Setter TargetName="Left_Highlight" Property="Fill" Value="{DynamicResource SubMenu_BD_Shadow_Highlight}" />
|
|
<Setter TargetName="Bottom_Shadow" Property="Fill" Value="{DynamicResource SubMenu_BD_Shadow_Select}" />
|
|
<Setter TargetName="Right_Shadow" Property="Fill" Value="{DynamicResource SubMenu_BD_Shadow_Select}" />
|
|
<Setter Property="Foreground" Value="{DynamicResource SubMenu_FG_Select}" />
|
|
<Setter Property="FontSize" Value="16" />
|
|
</DataTrigger>
|
|
<Trigger Property="IsHighlighted" Value="True">
|
|
<Setter TargetName="BG" Property="Background" Value="{DynamicResource SubMenu_BG_Select}" />
|
|
<Setter TargetName="Left_Part" Property="Fill" Value="{DynamicResource SubMenu_BG_Select}" />
|
|
<Setter TargetName="Right_Part" Property="Fill" Value="{DynamicResource SubMenu_BG_Select}" />
|
|
<Setter Property="Foreground" Value="{DynamicResource SubMenu_FG_Select}" />
|
|
</Trigger>
|
|
<Trigger Property="IsEnabled" Value="false">
|
|
<Setter Property="Foreground" Value="#FF9A9A9A" />
|
|
</Trigger>
|
|
</ControlTemplate.Triggers>
|
|
</ControlTemplate>
|
|
|
|
<Style x:Key="BottomSubMenu" TargetType="MenuItem">
|
|
<Setter Property="Command" Value="{Binding DataContext.MenuItemClickCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
|
|
<Setter Property="CommandParameter" Value="{Binding}" />
|
|
<Setter Property="Background" Value="Transparent" />
|
|
<Setter Property="Foreground" Value="{DynamicResource SubMenu_FG}" />
|
|
<Setter Property="FontFamily" Value="Arial" />
|
|
<Setter Property="MinWidth" Value="150" />
|
|
<Setter Property="Height" Value="32" />
|
|
<Setter Property="FontSize" Value="14" />
|
|
<Setter Property="FontWeight" Value="Normal" />
|
|
<Setter Property="Margin" Value="-3,0" />
|
|
<Setter Property="Template" Value="{StaticResource SubMenu_ShowOnBottom}" />
|
|
</Style>
|
|
|
|
<Style x:Key="MainMenu" TargetType="MenuItem">
|
|
<Setter Property="Command" Value="{Binding DataContext.MainMenuItemClickCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />
|
|
<Setter Property="CommandParameter" Value="{Binding}" />
|
|
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
|
|
<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
|
|
<Setter Property="Background" Value="Transparent" />
|
|
<Setter Property="Foreground" Value="{DynamicResource FG_White}" />
|
|
<Setter Property="FontSize" Value="16" />
|
|
<Setter Property="FontWeight" Value="Normal" />
|
|
<Setter Property="MinWidth" Value="130" />
|
|
<Setter Property="Margin" Value="0,0,30,0" />
|
|
<Setter Property="Height" Value="40" />
|
|
<Setter Property="Template" Value="{StaticResource SubMunu_ShowOnTop}" />
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding IsAlarm}" Value="True">
|
|
<Setter Property="Template" Value="{StaticResource SubMunu_ShowOnTop_Red}" />
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
|
|
</ResourceDictionary> |