<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks">
    <ControlTemplate x:Key="Menu_SubMenu_Template"
                     TargetType="{x:Type MenuItem}">

        <Border x:Name="border"
                Background="Transparent"
                BorderBrush="#0000a0"
                CornerRadius="5"
                BorderThickness="1"
                Height="50"
                Width="210">

            <Grid>

                <Grid.ColumnDefinitions>
                    <ColumnDefinition MinWidth="22"
                                      Width="Auto" />
                    <ColumnDefinition Width="5" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="20" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="5" />
                </Grid.ColumnDefinitions>

                <!--// Icon //-->

                <ContentPresenter x:Name="Icon"
                                  ContentSource="Icon"
                                  HorizontalAlignment="Left"
                                  Height="25"
                                  Width="35"
                                  Margin="1,0,0,0"
                                  VerticalAlignment="Center" />

                <!--// Menu Text //-->

                <ContentPresenter ContentSource="Header"
                                  Grid.Column="2"
                                  TextBlock.Foreground="#0000a0"
                                  TextBlock.FontFamily="Arial"
                                  TextBlock.FontSize="16"
                                  HorizontalAlignment="Left"
                                  RecognizesAccessKey="True"
                                  VerticalAlignment="Center" />

                <!--// Right Arrow Icon //-->

                <iconPacks:PackIconMaterial Kind="ArrowRightBoldCircle"
                                            Height="20"
                                            Width="20"
                                            Foreground="#0000a0"
                                            Grid.Column="4"
                                            HorizontalAlignment="Left"
                                            VerticalAlignment="Center"/>

                <!--// Popup //-->

                <Popup x:Name="PART_Popup"
                       AllowsTransparency="true"
                       Focusable="false"
                       HorizontalOffset="2"
                       IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}"
                       Placement="Right"
                       PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}"
                       VerticalOffset="0">

                    <Border x:Name="SubMenuBorder"
                            Background="Transparent"
                            CornerRadius="5">

                        <ScrollViewer x:Name="SubMenuScrollViewer"
                                      Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer, TypeInTargetAssembly={x:Type FrameworkElement}}}">

                            <Grid RenderOptions.ClearTypeHint="Enabled">

                                <Canvas HorizontalAlignment="Left"
                                        VerticalAlignment="Top" />

                                <ItemsPresenter x:Name="ItemsPresenter"
                                                KeyboardNavigation.DirectionalNavigation="Cycle"
                                                Grid.IsSharedSizeScope="true"
                                                KeyboardNavigation.TabNavigation="Cycle" />
                            </Grid>
                        </ScrollViewer>
                    </Border>
                </Popup>

            </Grid>
        </Border>


        <ControlTemplate.Triggers>

            <Trigger Property="IsSuspendingPopupAnimation"
                     Value="true">
                <Setter Property="PopupAnimation"
                        TargetName="PART_Popup"
                        Value="None" />
            </Trigger>

            <Trigger Property="Icon"
                     Value="{x:Null}">
                <Setter Property="Visibility"
                        TargetName="Icon"
                        Value="Visible" />
            </Trigger>

            <Trigger Property="IsChecked"
                     Value="True">
                <Setter Property="Visibility"
                        TargetName="Icon"
                        Value="Visible" />
            </Trigger>

            <Trigger Property="IsHighlighted"
                     Value="True">
                <Setter Property="Background"
                        TargetName="border"
                        Value="orange" />
                <Setter Property="BorderBrush"
                        TargetName="border"
                        Value="#404D5B" />
            </Trigger>

        </ControlTemplate.Triggers>
    </ControlTemplate>

    <ControlTemplate x:Key="Item_Template"
                     TargetType="{x:Type MenuItem}">

        <Border x:Name="border"
                BorderBrush="#0000a0"
                CornerRadius="5"
                Background="Orange"
                BorderThickness="{TemplateBinding BorderThickness}"
                Height="50"
                Width="250"
               >

            <Grid>

                <Grid.ColumnDefinitions>
                    <ColumnDefinition MinWidth="22"
                                      Width="Auto" />
                    <ColumnDefinition Width="5" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="20" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="5" />
                </Grid.ColumnDefinitions>

                <!--// Icon //-->

                <ContentPresenter x:Name="Icon"
                                  ContentSource="Icon"
                                  HorizontalAlignment="Center"
                                  Height="35"
                                  Width="35"
                                  Margin="10,0,0,0"
                                  VerticalAlignment="Center" />

                <!--// Menu Text //-->

                <ContentPresenter ContentSource="Header"
                                  Grid.Column="2"
                                  TextBlock.Foreground="#0000a0"
                                  TextBlock.FontFamily="Arial"
                                  TextBlock.FontSize="16"
                                  HorizontalAlignment="Left"
                                  RecognizesAccessKey="True"
                                  Margin="3,0,0,0"
                                  VerticalAlignment="Center" />


            </Grid>
        </Border>


        <ControlTemplate.Triggers>

            <Trigger Property="Icon"
                     Value="{x:Null}">
                <Setter Property="Visibility"
                        TargetName="Icon"
                        Value="Visible" />
            </Trigger>

            <Trigger Property="IsChecked"
                     Value="True">
                <Setter Property="Visibility"
                        TargetName="Icon"
                        Value="Visible" />
            </Trigger>

            <Trigger Property="IsHighlighted"
                     Value="True">
                <Setter Property="Background"
                        TargetName="border"
                        Value="#d7e8fd" />
                <Setter Property="BorderBrush"
                        TargetName="border"
                        Value="#404D5B" />
            </Trigger>

        </ControlTemplate.Triggers>
    </ControlTemplate>
</ResourceDictionary>