<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">

    <ControlTemplate x:Key="SubMenuItem" TargetType="{x:Type MenuItem}">
        <ControlTemplate.Resources>
            <Storyboard x:Key="SubMenuOnMouseOver">
                <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="SubMenuOnMouseOut">
                <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 Margin="0,3" SnapsToDevicePixels="true">
            <Rectangle
                x:Name="HighLight"
                Margin="-2,-2,-3,2"
                Fill="{DynamicResource Color_BG_SubMenu_OnMouseOver}"
                Opacity="0" />
            <ContentPresenter
                x:Name="contentPresenter"
                Grid.Column="0"
                Margin="16,0"
                VerticalAlignment="Center"
                ContentSource="Header"
                RecognizesAccessKey="True"
                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
            <Rectangle
                Height="1"
                VerticalAlignment="Bottom"
                Fill="{DynamicResource Color_BG_SubMenu_LineHighlight}">
                <Rectangle.OpacityMask>
                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                        <GradientStop Offset="0" />
                        <GradientStop Offset="1" />
                        <GradientStop Offset="0.2" Color="White" />
                        <GradientStop Offset="0.8" Color="White" />
                    </LinearGradientBrush>
                </Rectangle.OpacityMask>
            </Rectangle>
            <Rectangle
                Height="1"
                Margin="0,0,0,2"
                VerticalAlignment="Bottom"
                Fill="{DynamicResource Color_BG_SubMenu_LineShadow}"
                StrokeThickness="2">
                <Rectangle.OpacityMask>
                    <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
                        <GradientStop Offset="0" />
                        <GradientStop Offset="1" />
                        <GradientStop Offset="0.2" Color="White" />
                        <GradientStop Offset="0.8" Color="White" />
                    </LinearGradientBrush>
                </Rectangle.OpacityMask>
            </Rectangle>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="Icon" Value="{x:Null}" />
            <Trigger Property="IsChecked" Value="true" />
            <Trigger Property="IsHighlighted" Value="true">
                <Trigger.ExitActions>
                    <BeginStoryboard x:Name="SubMenuOnMouseOut_BeginStoryboard" Storyboard="{StaticResource SubMenuOnMouseOut}" />
                </Trigger.ExitActions>
                <Trigger.EnterActions>
                    <BeginStoryboard Storyboard="{StaticResource SubMenuOnMouseOver}" />
                </Trigger.EnterActions>
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Foreground" Value="#FF9A9A9A" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <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="#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" StartPoint="0.5,0" EndPoint="0.5,1">
        <GradientStop Offset="0" Color="#FF5788BC" />
        <GradientStop Offset="1" Color="#FF71A6CF" />
        <GradientStop Offset="0.4" Color="#FF6191B8" />
        <GradientStop Offset="0.401" Color="#FF375E97" />
        <GradientStop Offset="0.9" Color="#FF77A9CE" />
    </LinearGradientBrush>
    <SolidColorBrush x:Key="Menu_Main_BG_Outer_Highlight" Color="White" />
    <LinearGradientBrush x:Key="Menu_Main_BG_Inner_Highlight" StartPoint="0.5,0" EndPoint="0.5,1">
        <GradientStop Offset="0" Color="#FFA4F0E0" />
        <GradientStop Offset="1" Color="#FFBEFAE7" />
        <GradientStop Offset="0.4" Color="#FF49BD9A" />
        <GradientStop Offset="0.401" Color="#FF147B63" />
        <GradientStop Offset="0.9" Color="#FF7DE8BD" />
    </LinearGradientBrush>

    <ControlTemplate x:Key="SubMunu_ShowOnTop" TargetType="{x:Type MenuItem}">
        <Grid SnapsToDevicePixels="true">
            <Border
                x:Name="BG"
                Background="{DynamicResource Menu_Main_BG_Outer}"
                BorderBrush="{DynamicResource Menu_Main_BD_Highlight}"
                BorderThickness="3,3,0,0"
                CornerRadius="5"
                Cursor="Hand">
                <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"
                            Fill="{DynamicResource Menu_Main_BG_Inner}"
                            RadiusX="3"
                            RadiusY="3" />
                        <Grid x:Name="Content_Grid" SnapsToDevicePixels="true">
                            <Grid.Effect>
                                <DropShadowEffect
                                    BlurRadius="8"
                                    ShadowDepth="0"
                                    Color="White" />
                            </Grid.Effect>
                            <ContentPresenter
                                x:Name="contentPresenter"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                ContentSource="Header"
                                Cursor="Hand"
                                RecognizesAccessKey="True"
                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
                                <ContentPresenter.Effect>
                                    <DropShadowEffect
                                        BlurRadius="8"
                                        ShadowDepth="0"
                                        Color="White" />
                                </ContentPresenter.Effect>
                            </ContentPresenter>
                        </Grid>
                    </Grid>
                </Border>
            </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 Property="Foreground" Value="{DynamicResource FG_Black}" />
                <Setter TargetName="Content_Grid" Property="Effect">
                    <Setter.Value>
                        <DropShadowEffect
                            BlurRadius="8"
                            Opacity="0.5"
                            ShadowDepth="0"
                            Color="White" />
                    </Setter.Value>
                </Setter>
                <Setter TargetName="contentPresenter" Property="Effect">
                    <Setter.Value>
                        <DropShadowEffect
                            BlurRadius="8"
                            ShadowDepth="0"
                            Color="White" />
                    </Setter.Value>
                </Setter>
                <Setter TargetName="InnerBG" Property="Fill" Value="{DynamicResource Menu_Main_BG_Inner_Highlight}" />
                <Setter TargetName="BG" Property="Background" Value="{DynamicResource Menu_Main_BG_Outer_Highlight}" />
            </Trigger>
            <DataTrigger Binding="{Binding Selected}" Value="True">
                <Setter Property="Foreground" Value="{DynamicResource FG_White}" />
                <Setter TargetName="Content_Grid" Property="Effect">
                    <Setter.Value>
                        <DropShadowEffect
                            BlurRadius="10"
                            Opacity="0.5"
                            ShadowDepth="0"
                            Color="Black" />
                    </Setter.Value>
                </Setter>
                <Setter TargetName="contentPresenter" Property="Effect">
                    <Setter.Value>
                        <DropShadowEffect
                            BlurRadius="10"
                            ShadowDepth="0"
                            Color="Black" />
                    </Setter.Value>
                </Setter>
                <Setter TargetName="InnerBG" Property="Fill" Value="{DynamicResource Menu_Main_BG_Inner_Highlight}" />
                <Setter TargetName="BG" Property="Background" 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"
            Background="{DynamicResource SubMenu_BG}"
            BorderBrush="{DynamicResource SubMenu_BD_Shadow}"
            BorderThickness="0,0,2,2"
            CornerRadius="0,0,5,5"
            Cursor="Hand">
            <Border
                x:Name="InnerBD"
                BorderBrush="{DynamicResource SubMenu_BD_Highlight}"
                BorderThickness="2,0,0,0"
                CornerRadius="0,0,4,4">
                <ContentPresenter
                    x:Name="contentPresenter"
                    Margin="6,0"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    ContentSource="Header"
                    Cursor="Hand"
                    RecognizesAccessKey="True"
                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
            </Border>
        </Border>
        <ControlTemplate.Triggers>
            <DataTrigger Binding="{Binding Selected}" Value="True">
                <Setter TargetName="BG" Property="Background" Value="{DynamicResource SubMenu_BG_Select}" />
                <Setter TargetName="BG" Property="BorderBrush" Value="{DynamicResource SubMenu_BD_Shadow_Select}" />
                <Setter TargetName="InnerBD" Property="BorderBrush" Value="{DynamicResource SubMenu_BD_Highlight}" />
                <Setter Property="Foreground" Value="{DynamicResource SubMenu_FG_Select}" />
                <Setter Property="FontSize" Value="16" />
                <Setter TargetName="contentPresenter" Property="Effect">
                    <Setter.Value>
                        <DropShadowEffect
                            BlurRadius="5"
                            ShadowDepth="0"
                            Color="White" />
                    </Setter.Value>
                </Setter>
            </DataTrigger>
            <Trigger Property="IsHighlighted" Value="True">
                <Setter TargetName="BG" Property="Background" 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="100" />
        <Setter Property="Height" Value="35" />
        <Setter Property="FontSize" Value="14" />
        <Setter Property="FontWeight" Value="bold" />
        <Setter Property="Margin" Value="0,-1" />
        <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>