| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314 | <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 SnapsToDevicePixels="true" Background="Transparent">                        <Rectangle x:Name="R1" Fill="Transparent" Width="1" DockPanel.Dock="Right"/>                        <Rectangle x:Name="B1" Fill="Transparent" Height="1" DockPanel.Dock="Bottom"/>                        <Rectangle x:Name="L1" Fill="Transparent" Width="1" DockPanel.Dock="Left"/>                        <Rectangle x:Name="T1" Fill="Transparent" Height="1" DockPanel.Dock="Top"/>                        <ContentPresenter x:Name="ContentContainer" HorizontalAlignment="Center" Margin="2,2,2,2" VerticalAlignment="Center"/>                    </DockPanel>                    <ControlTemplate.Triggers>                        <Trigger Property="IsPressed" Value="true">                            <Setter Property="Fill" TargetName="R1" Value="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}"/>                            <Setter Property="Fill" TargetName="B1" Value="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}"/>                            <Setter Property="Fill" TargetName="L1" Value="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}"/>                            <Setter Property="Fill" TargetName="T1" Value="{DynamicResource {x:Static SystemColors.ControlDarkDarkBrushKey}}"/>                            <Setter Property="Margin" TargetName="ContentContainer" 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.Column="0" Grid.Row="1">                            <ScrollContentPresenter Margin="{TemplateBinding Padding}"/>                        </Border>                        <RepeatButton Style="{StaticResource MenuScrollButton}" Focusable="false" Command="{x:Static ScrollBar.LineUpCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Grid.Column="0" Grid.Row="0">                            <RepeatButton.Visibility>                                <MultiBinding FallbackValue="Visibility.Collapsed" Converter="{StaticResource MenuScrollingVisibilityConverter}" ConverterParameter="0">                                    <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 Fill="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}" Data="{StaticResource UpArrow}"/>                        </RepeatButton>                        <RepeatButton Style="{StaticResource MenuScrollButton}" Focusable="false" Command="{x:Static ScrollBar.LineDownCommand}" CommandTarget="{Binding RelativeSource={RelativeSource TemplatedParent}}" Grid.Column="0" Grid.Row="2">                            <RepeatButton.Visibility>                                <MultiBinding FallbackValue="Visibility.Collapsed" Converter="{StaticResource MenuScrollingVisibilityConverter}" ConverterParameter="100">                                    <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 Fill="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}" Data="{StaticResource DownArrow}"/>                        </RepeatButton>                    </Grid>                </ControlTemplate>            </Setter.Value>        </Setter>    </Style>    <ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuContent, TypeInTargetAssembly={x:Type FrameworkElement}}" TargetType="{x:Type ContentControl}">        <Border SnapsToDevicePixels="True" Background="{DynamicResource Color_BG_SubMenuBG}" MinWidth="{TemplateBinding ActualWidth}" BorderThickness="1" BorderBrush="{DynamicResource Color_BD_SubMenu}" Padding="5,0">            <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.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Highlight">                    <EasingDoubleKeyFrame KeyTime="0" Value="0"/>                    <SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="1" KeySpline="0,0,1,0"/>                </DoubleAnimationUsingKeyFrames>            </Storyboard>            <Storyboard x:Key="OnMouseOut">                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Highlight">                    <EasingDoubleKeyFrame KeyTime="0" Value="1"/>                    <SplineDoubleKeyFrame KeyTime="0:0:0.2" Value="0" KeySpline="0,0,0,1"/>                </DoubleAnimationUsingKeyFrames>            </Storyboard>        </ControlTemplate.Resources>        <Grid SnapsToDevicePixels="true">            <Border x:Name="BG" BorderBrush="{DynamicResource Color_BD_Menu}" BorderThickness="1" Cursor="Hand" Background="{DynamicResource Color_BG_Menu}">                <Border.Effect>                    <DropShadowEffect Color="#FFC6E9FF" ShadowDepth="0" BlurRadius="10"/>                </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" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header" RecognizesAccessKey="True" HorizontalAlignment="Center" VerticalAlignment="Center" Cursor="Hand">            </ContentPresenter>            <Popup x:Name="PART_Popup" AllowsTransparency="true" HorizontalOffset="1" IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Bottom" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}" VerticalOffset="2" Focusable="false" MinWidth="150" Grid.Column="1">                <ContentControl x:Name="SubMenuBorder" IsTabStop="false" Template="{DynamicResource {ComponentResourceKey ResourceId=SubmenuContent, TypeInTargetAssembly={x:Type FrameworkElement}}}">                    <ScrollViewer Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}" CanContentScroll="true">                        <ItemsPresenter Margin="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.IsSharedSizeScope="true" KeyboardNavigation.DirectionalNavigation="Cycle" KeyboardNavigation.TabNavigation="Cycle" Cursor="Hand"/>                    </ScrollViewer>                </ContentControl>            </Popup>        </Grid>        <ControlTemplate.Triggers>            <Trigger Property="IsSuspendingPopupAnimation" Value="true">                <Setter Property="PopupAnimation" TargetName="PART_Popup" Value="None"/>            </Trigger>            <Trigger Property="Icon" Value="{x:Null}"/>            <Trigger Property="IsChecked" Value="true"/>            <Trigger Property="HasDropShadow" SourceName="PART_Popup" 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 Property="Opacity" TargetName="Highlight" 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="#FF3EAFE2"/>    <SolidColorBrush x:Key="Menu_Main_BG" Color="#FF0C1F6B"/>    <SolidColorBrush x:Key="Menu_Main_BG_Highlight" Color="#FF2DACCB"/>    <SolidColorBrush x:Key="Menu_Main_BG_Outer" Color="#FFA3B7D3"/>    <SolidColorBrush x:Key="Menu_Main_BD_Highlight" Color="#FF88A0CE"/>    <SolidColorBrush x:Key="Menu_Main_BD_Shadow" Color="#FF111A2B"/>    <LinearGradientBrush x:Key="Menu_Main_BG_Inner" EndPoint="0.5,1" StartPoint="0.5,0">        <GradientStop Color="#FF5788BC" Offset="0"/>        <GradientStop Color="#FF71A6CF" Offset="1"/>        <GradientStop Color="#FF6191B8" Offset="0.4"/>        <GradientStop Color="#FF375E97" Offset="0.401"/>        <GradientStop Color="#FF77A9CE" Offset="0.9"/>    </LinearGradientBrush>    <SolidColorBrush x:Key="Menu_Main_BG_Outer_Highlight" Color="White"/>    <LinearGradientBrush x:Key="Menu_Main_BG_Inner_Highlight" EndPoint="0.5,1" StartPoint="0.5,0">        <GradientStop Color="#FFA4F0E0" Offset="0"/>        <GradientStop Color="#FFBEFAE7" Offset="1"/>        <GradientStop Color="#FF49BD9A" Offset="0.4"/>        <GradientStop Color="#FF147B63" Offset="0.401"/>        <GradientStop Color="#FF7DE8BD" Offset="0.9"/>    </LinearGradientBrush>    <ControlTemplate x:Key="SubMunu_ShowOnTop" TargetType="{x:Type MenuItem}">        <Grid SnapsToDevicePixels="true">            <Border x:Name="BG" BorderBrush="{DynamicResource Menu_Main_BD_Highlight}" BorderThickness="3,3,0,0" CornerRadius="5" Cursor="Hand" Background="{DynamicResource Menu_Main_BG_Outer}">                <Border x:Name="InnerBD" BorderBrush="{DynamicResource Menu_Main_BD_Shadow}" BorderThickness="0,0,3,3" CornerRadius="5">                    <Grid Width="Auto">                        <Rectangle x:Name="InnerBG" Margin="1" RadiusX="3" RadiusY="3" Fill="{DynamicResource Menu_Main_BG_Inner}"/>                        <Grid x:Name="Content_Grid" SnapsToDevicePixels="true">                            <Grid.Effect>                                <DropShadowEffect ShadowDepth="0" BlurRadius="8" Color="White"/>                            </Grid.Effect>                            <ContentPresenter x:Name="contentPresenter" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" ContentSource="Header" RecognizesAccessKey="True" HorizontalAlignment="Center" VerticalAlignment="Center" Cursor="Hand">                                <ContentPresenter.Effect>                                    <DropShadowEffect BlurRadius="8" ShadowDepth="0" Color="White"/>                                </ContentPresenter.Effect>                            </ContentPresenter>                        </Grid>                    </Grid>                </Border>            </Border>            <Popup x:Name="PART_Popup" AllowsTransparency="true" HorizontalOffset="0" IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}" Placement="Top" PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}" VerticalOffset="-2" Focusable="false" MinWidth="150" Grid.Column="1">                <ContentControl x:Name="SubMenuBorder" IsTabStop="false" Template="{DynamicResource {ComponentResourceKey ResourceId=SubmenuContent, TypeInTargetAssembly={x:Type FrameworkElement}}}">                    <ScrollViewer Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}" CanContentScroll="true">                        <ItemsPresenter Margin="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.IsSharedSizeScope="true" KeyboardNavigation.DirectionalNavigation="Cycle" KeyboardNavigation.TabNavigation="Cycle" Cursor="Hand"/>                    </ScrollViewer>                </ContentControl>            </Popup>        </Grid>        <ControlTemplate.Triggers>            <Trigger Property="IsSuspendingPopupAnimation" Value="true">                <Setter Property="PopupAnimation" TargetName="PART_Popup" Value="None"/>            </Trigger>            <Trigger Property="Icon" Value="{x:Null}"/>            <Trigger Property="IsChecked" Value="true"/>            <Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true"/>            <Trigger Property="IsHighlighted" Value="true">                <Setter Property="Foreground" Value="{DynamicResource FG_Black}"/>                <Setter Property="Effect" TargetName="Content_Grid">                    <Setter.Value>                        <DropShadowEffect BlurRadius="8" Color="White" ShadowDepth="0" Opacity="0.5"/>                    </Setter.Value>                </Setter>                <Setter Property="Effect" TargetName="contentPresenter">                    <Setter.Value>                        <DropShadowEffect BlurRadius="8" Color="White" ShadowDepth="0"/>                    </Setter.Value>                </Setter>                <Setter Property="Fill" TargetName="InnerBG" Value="{DynamicResource Menu_Main_BG_Inner_Highlight}"/>                <Setter Property="Background" TargetName="BG" Value="{DynamicResource Menu_Main_BG_Outer_Highlight}"/>            </Trigger>            <DataTrigger Binding="{Binding Selected}" Value="True">                <Setter Property="Foreground" Value="{DynamicResource FG_White}"/>                <Setter Property="Effect" TargetName="Content_Grid">                    <Setter.Value>                        <DropShadowEffect BlurRadius="10" Color="Black" ShadowDepth="0" Opacity="0.5"/>                    </Setter.Value>                </Setter>                <Setter Property="Effect" TargetName="contentPresenter">                    <Setter.Value>                        <DropShadowEffect BlurRadius="10" Color="Black" ShadowDepth="0"/>                    </Setter.Value>                </Setter>                <Setter Property="Fill" TargetName="InnerBG" Value="{DynamicResource Menu_Main_BG_Inner_Highlight}"/>                <Setter Property="Background" TargetName="BG" Value="{DynamicResource Menu_Main_BG_Outer_Highlight}"/>            </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}">        <Border x:Name="BG" BorderBrush="{DynamicResource SubMenu_BD_Shadow}" BorderThickness="0,0,1,1" Background="{DynamicResource SubMenu_BG}" Cursor="Hand">            <Border x:Name="InnerBD" BorderBrush="{DynamicResource SubMenu_BD_Highlight}" BorderThickness="1,1,0,0">                <ContentPresenter x:Name="contentPresenter" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Margin="6,0" Cursor="Hand" ContentSource="Header" RecognizesAccessKey="True" HorizontalAlignment="Center" VerticalAlignment="Center">                    <ContentPresenter.Effect>                        <DropShadowEffect BlurRadius="5" Color="Black" ShadowDepth="0"/>                    </ContentPresenter.Effect>                </ContentPresenter>            </Border>        </Border>        <ControlTemplate.Triggers>            <DataTrigger Binding="{Binding Selected}" Value="True">                <Setter Property="Background" TargetName="BG" Value="{DynamicResource SubMenu_BG_Select}"/>                <Setter Property="BorderBrush" TargetName="BG" Value="{DynamicResource SubMenu_BD_Shadow_Select}"/>                <Setter Property="BorderBrush" TargetName="InnerBD" Value="{DynamicResource SubMenu_BD_Select}"/>                <Setter Property="Foreground" Value="{DynamicResource SubMenu_FG_Select}"/>                <Setter Property="FontSize" Value="16"/>                <Setter Property="Effect" TargetName="contentPresenter">                    <Setter.Value>                        <DropShadowEffect BlurRadius="5" Color="White" ShadowDepth="0"/>                    </Setter.Value>                </Setter>            </DataTrigger>            <Trigger Property="IsHighlighted" Value="True">                <Setter Property="Background" TargetName="BG" Value="{DynamicResource SubMenu_BG_Highlight}"/>                <Setter Property="BorderBrush" TargetName="BG" Value="{DynamicResource SubMenu_BD_Shadow_Highlight}"/>                <Setter Property="BorderBrush" TargetName="InnerBD" Value="{DynamicResource SubMenu_BD_Highlight}"/>            </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="100"/>        <Setter Property="Height" Value="35"/>        <Setter Property="FontSize" Value="14"/>        <Setter Property="FontWeight" Value="bold"/>        <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_Black}"/>        <Setter Property="FontSize" Value="16"/>        <Setter Property="FontWeight" Value="Bold"/>        <Setter Property="MinWidth" Value="140"/>        <Setter Property="Margin" Value="5,0,0,0"/>        <Setter Property="Height" Value="45"/>        <Setter Property="Template" Value="{StaticResource SubMunu_ShowOnTop}"/>    </Style></ResourceDictionary>
 |