<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:dhcc="http://www.dhcc.com.cn"
                    xmlns:local="clr-namespace:Platform.Controls.TableContainer"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic">

    <ControlTemplate x:Key="StyleNumber2" TargetType="{x:Type local:TreeViewListItem}">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <ToggleButton x:Name="Expander"
                          Grid.Column="0"
                          Width="11"
                          Height="11"
                          Margin="2,0,0,0"
                          Background="{DynamicResource Level1NotExpand}"
                          BorderBrush="Transparent"
                          ClickMode="Press"
                          IsChecked="{Binding Path=IsExpanded,
                                              RelativeSource={RelativeSource TemplatedParent}}"
                          Style="{DynamicResource ImageToggleStyle}" />
            <!--
                IsChecked="{Binding Path=IsExpanded,
                RelativeSource={RelativeSource TemplatedParent}}"
            -->
            <Border Name="Bd"
                    Grid.Column="1"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Padding="{TemplateBinding Padding}">
                <Grid>
                    <Grid.ColumnDefinitions>

                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>

                    <CheckBox x:Name="checkBox"
                              Grid.Column="0"
                              Height="{Binding Path=Height,
                                               RelativeSource={RelativeSource TemplatedParent}}"
                              Margin="2,0,2,0"
                              HorizontalAlignment="Center"
                              VerticalAlignment="Center"
                              ClickMode="Press"
                              IsChecked="{Binding Path=IsChecked,
                                                  RelativeSource={RelativeSource TemplatedParent}}"
                              Visibility="{Binding Path=CheckBoxVisibility,
                                                   RelativeSource={RelativeSource TemplatedParent}}" />
                    <!--
                        IsChecked="{Binding Path=IsChecked,
                        RelativeSource={RelativeSource TemplatedParent}}"
                    -->


                    <Image Name="image"
                           Grid.Column="1"
                           Width="15"
                           Height="15"
                           Margin="1,0,2,0"
                           HorizontalAlignment="Center"
                           VerticalAlignment="Center"
                           Source="/Platform.Controls;component/Resource/3.ico" />

                    <StackPanel x:Name="PART_Header"
                                Grid.Column="2"
                                HorizontalAlignment="Left"
                                VerticalAlignment="Center"
                                Orientation="Horizontal">
                        <!--  <TextBlock Text=" " />  -->
                        <ContentPresenter Margin="0,4" ContentSource="SortIndex" />
                        <TextBlock Margin="0,4" Text="-" />
                        <ContentPresenter Margin="4"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          ContentSource="Header" />
                    </StackPanel>
                </Grid>
            </Border>
            <ItemsPresenter x:Name="ItemsHost"
                            Grid.Row="1"
                            Grid.Column="1"
                            Grid.ColumnSpan="2" />
        </Grid>
        <ControlTemplate.Triggers>

            <Trigger Property="IsExpanded" Value="false">
                <Setter Property="Foreground" Value="white" />
                <Setter Property="FontWeight" Value="Normal" />
                <Setter TargetName="ItemsHost" Property="Visibility" Value="Collapsed" />
                <Setter TargetName="image" Property="Source" Value="/Platform.Controls;component/Resource/9.ico" />
            </Trigger>
            <Trigger Property="IsExpanded" Value="true">
                <Setter Property="Foreground" Value="white" />
                <Setter Property="FontWeight" Value="Normal" />
                <Setter TargetName="Expander" Property="Background" Value="{DynamicResource Level1Expand}" />
            </Trigger>
            <Trigger Property="HasItems" Value="false">
                <Setter TargetName="Expander" Property="Background" Value="{DynamicResource Level2Brush}" />
                <Setter TargetName="Expander" Property="Height" Value="8" />
                <Setter TargetName="Expander" Property="Width" Value="8" />
            </Trigger>
            <Trigger Property="NodeLevel" Value="0">
                <Setter Property="FontWeight" Value="Bold" />
            </Trigger>
            <Trigger Property="NodeLevel" Value="-1">
                <Setter TargetName="image" Property="Source" Value="/Platform.Controls;component/Resource/MenuTree_TradeSelected.png" />
                <Setter TargetName="image" Property="Visibility" Value="Collapsed" />
            </Trigger>

            <!--
                <Trigger Property="IsSelected" Value="False">
                
                <Setter Property="IsExpanded" Value="False" />
                </Trigger>
            -->

            <!--
                <Trigger Property="IsFocused" Value="False">
                <Setter Property="IsExpanded" Value="False" />
                </Trigger>
                <Trigger Property="IsFocused" Value="True">
                <Setter Property="IsExpanded" Value="True" />
                </Trigger>
            -->

            <!--
                <MultiTrigger>
                <MultiTrigger.Conditions>
                <Condition Property="IsSelected" Value="True" />
                <Condition Property="IsFocused" Value="True" />
                </MultiTrigger.Conditions>
                <Setter  Property="IsExpanded" Value="True" />
                </MultiTrigger>
            -->

            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="HasHeader" Value="false" />
                    <Condition Property="Width" Value="Auto" />
                </MultiTrigger.Conditions>
                <Setter TargetName="PART_Header" Property="MinWidth" Value="75" />
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="HasHeader" Value="false" />
                    <Condition Property="Height" Value="Auto" />
                </MultiTrigger.Conditions>
                <Setter TargetName="PART_Header" Property="MinHeight" Value="19" />
            </MultiTrigger>
            <Trigger Property="IsSelected" Value="true">
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource StyleNumber1_SelectedBrush}" />
                <Setter Property="Foreground" Value="black" />
                <!--  <Setter Property="IsExpanded" Value="true" />  -->
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsSelected" Value="true" />
                    <Condition Property="IsSelectionActive" Value="false" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource StyleNumber1_SelectedBrush}" />
                <Setter Property="Foreground" Value="Black" />
            </MultiTrigger>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Cursor" Value="Hand" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <ControlTemplate x:Key="StyleNumber1" TargetType="{x:Type local:TreeViewListItem}">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" MinWidth="19" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <ToggleButton x:Name="Expander"
                          ClickMode="Press"
                          IsChecked="{Binding Path=IsExpanded,
                                              RelativeSource={RelativeSource TemplatedParent}}"
                          Style="{DynamicResource ExpandCollapseToggleStyle}" />
            <Border Name="Bd"
                    Grid.Column="1"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Padding="{TemplateBinding Padding}">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <CheckBox x:Name="checkBox"
                              Grid.Column="0"
                              Height="{Binding Path=Height,
                                               RelativeSource={RelativeSource TemplatedParent}}"
                              Margin="2,0,2,0"
                              HorizontalAlignment="Center"
                              VerticalAlignment="Center"
                              IsChecked="{Binding Path=IsChecked,
                                                  RelativeSource={RelativeSource TemplatedParent}}"
                              Visibility="{Binding Path=CheckBoxVisibility,
                                                   RelativeSource={RelativeSource TemplatedParent}}" />
                    <Image Name="image"
                           Grid.Column="1"
                           Width="15"
                           Height="15"
                           Margin="2,0,2,0"
                           HorizontalAlignment="Center"
                           VerticalAlignment="Center"
                           Source="/Platform.Controls;component/Resource/Expanded.ico" />
                    <StackPanel x:Name="PART_Header"
                                Grid.Column="2"
                                Margin="4"
                                HorizontalAlignment="Left"
                                VerticalAlignment="Center"
                                Orientation="Horizontal">
                        <TextBlock Text=" " />
                        <ContentPresenter ContentSource="SortIndex" />
                        <TextBlock Text=" - " />
                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" ContentSource="Header" />
                    </StackPanel>
                </Grid>
            </Border>
            <ItemsPresenter x:Name="ItemsHost"
                            Grid.Row="1"
                            Grid.Column="1"
                            Grid.ColumnSpan="2" />
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsExpanded" Value="false">
                <Setter Property="Foreground" Value="White" />
                <Setter Property="FontWeight" Value="Normal" />
                <Setter TargetName="ItemsHost" Property="Visibility" Value="Collapsed" />
                <!--  <Setter TargetName="image" Property="Source" Value="/TellerSys.Resources;component/3.ico" />  -->
            </Trigger>
            <Trigger Property="HasItems" Value="false">
                <Setter Property="Foreground" Value="White" />
                <Setter Property="FontWeight" Value="Normal" />
                <Setter TargetName="Expander" Property="Visibility" Value="Hidden" />
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="HasHeader" Value="false" />
                    <Condition Property="Width" Value="Auto" />
                </MultiTrigger.Conditions>
                <Setter TargetName="PART_Header" Property="MinWidth" Value="75" />
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="HasHeader" Value="false" />
                    <Condition Property="Height" Value="Auto" />
                </MultiTrigger.Conditions>
                <Setter TargetName="PART_Header" Property="MinHeight" Value="19" />
            </MultiTrigger>
            <Trigger Property="IsSelected" Value="true">
                <Setter Property="Foreground" Value="white" />
                <!--  <Setter TargetName="Bd" Property="Background" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />  -->
                <!--  <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}" />  -->
                <Setter Property="IsExpanded" Value="true" />
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsSelected" Value="true" />
                    <Condition Property="IsSelectionActive" Value="false" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" />
                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
            </MultiTrigger>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Cursor" Value="Hand" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <ControlTemplate x:Key="StyleNumber0" TargetType="{x:Type local:TreeViewListItem}">
        <Grid x:Name="grid" Width="{TemplateBinding Width}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" MinWidth="19" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <ToggleButton x:Name="FirstExpander"
                          Width="15"
                          Height="13"
                          ClickMode="Press"
                          IsChecked="{Binding Path=IsExpanded,
                                              RelativeSource={RelativeSource TemplatedParent}}"
                          Style="{DynamicResource ImageToggleStyle}"
                          Visibility="Collapsed" />
            <Border Name="Bd"
                    Grid.Row="0"
                    Grid.Column="0"
                    Grid.ColumnSpan="3"
                    Width="{Binding ElementName=grid,
                                    Path=Width}"
                    Height="28"
                    HorizontalAlignment="Left"
                    VerticalAlignment="Center"
                    Background="{TemplateBinding Background}"
                    BorderBrush="{TemplateBinding BorderBrush}"
                    BorderThickness="{TemplateBinding BorderThickness}"
                    Padding="{TemplateBinding Padding}">
                <Border Name="InnerBd"
                        Width="{Binding ElementName=Bd,
                                        Path=Width}"
                        Height="{Binding ElementName=Bd,
                                         Path=Height}"
                        Margin="-1,0,0,0"
                        BorderBrush="Transparent"
                        BorderThickness="0">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <CheckBox x:Name="checkBox"
                                  Grid.Column="0"
                                  Height="{Binding Path=Height,
                                                   RelativeSource={RelativeSource TemplatedParent}}"
                                  Margin="2,0,2,0"
                                  HorizontalAlignment="Center"
                                  VerticalAlignment="Center"
                                  IsChecked="{Binding Path=IsChecked,
                                                      RelativeSource={RelativeSource TemplatedParent}}"
                                  Visibility="{Binding Path=CheckBoxVisibility,
                                                       RelativeSource={RelativeSource TemplatedParent}}" />
                        <ToggleButton Name="imageToggleButton"
                                      Grid.Column="1"
                                      Width="11"
                                      Height="11"
                                      Margin="20,0,5,0"
                                      HorizontalAlignment="Center"
                                      VerticalAlignment="Center"
                                      BorderBrush="Transparent"
                                      ClickMode="Press"
                                      IsChecked="{Binding Path=IsExpanded,
                                                          RelativeSource={RelativeSource TemplatedParent}}"
                                      Style="{DynamicResource ImageToggleStyle}"
                                      Visibility="Visible" />
                        <StackPanel x:Name="PART_Header"
                                    Grid.Column="2"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Center"
                                    Orientation="Horizontal">
                            <TextBlock Text=" " />
                            <ContentPresenter ContentSource="SortIndex" />
                            <TextBlock Text=" -" />
                            <ContentPresenter HorizontalAlignment="Left"
                                              VerticalAlignment="Center"
                                              ContentSource="Header" />
                        </StackPanel>
                        <ToggleButton x:Name="Expander"
                                      Grid.Column="3"
                                      Margin="0,0,5,0"
                                      HorizontalAlignment="Left"
                                      VerticalAlignment="Center"
                                      Background="{DynamicResource Expander_Normal}"
                                      ClickMode="Press"
                                      IsChecked="{Binding Path=IsExpanded,
                                                          RelativeSource={RelativeSource TemplatedParent}}"
                                      Style="{DynamicResource ExpandCollapseToggleStyle}"
                                      Visibility="Collapsed" />


                    </Grid>
                </Border>
            </Border>
            <ItemsPresenter x:Name="ItemsHost"
                            Grid.Row="1"
                            Grid.Column="0"
                            Grid.ColumnSpan="2" />
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="IsExpanded" Value="false">
                <Setter TargetName="ItemsHost" Property="Visibility" Value="Collapsed" />
            </Trigger>
            <Trigger Property="HasItems" Value="false">
                <Setter TargetName="Expander" Property="Visibility" Value="Hidden" />
                <Setter TargetName="FirstExpander" Property="Visibility" Value="Hidden" />
            </Trigger>
            <MultiTrigger>
                <!--  在多极里可以去掉 没有必要那么长  -->
                <MultiTrigger.Conditions>
                    <Condition Property="HasHeader" Value="false" />
                    <Condition Property="Width" Value="Auto" />
                </MultiTrigger.Conditions>
                <Setter TargetName="PART_Header" Property="MinWidth" Value="75" />
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="HasHeader" Value="false" />
                    <Condition Property="Height" Value="Auto" />
                </MultiTrigger.Conditions>
                <Setter TargetName="PART_Header" Property="MinHeight" Value="19" />
            </MultiTrigger>
            <!--  Default Style Start  -->
            <!--  一级节点设置  -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition Property="NodeLevel" Value="0" />
                    <Condition Property="HasItems" Value="True" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Expander" Property="Visibility" Value="Visible" />
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition Property="NodeLevel" Value="0" />
                </MultiTrigger.Conditions>
                <Setter TargetName="imageToggleButton" Property="Visibility" Value="Collapsed" />
                <Setter Property="Foreground" Value="White" />
                <Setter Property="FontWeight" Value="Bold" />
                <Setter TargetName="PART_Header" Property="Margin" Value="20,0,0,0" />
                <!--
                    <Setter TargetName="InnerBd" Property="BorderBrush" Value="{DynamicResource Level0TopBottom}" />
                    <Setter TargetName="InnerBd" Property="BorderThickness" Value="0,1,0,1" />
                -->
                <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Level0TopBottom}" />
                <Setter TargetName="Bd" Property="BorderThickness" Value="0,1,0,1" />
                <!--
                    <Setter TargetName="InnerBd" Property="BorderBrush" Value="{DynamicResource LeftRightBrush}" />
                    <Setter TargetName="InnerBd" Property="BorderThickness" Value="1,0,1,0" />
                -->
            </MultiTrigger>
            <!--  一级节点正常状态  -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="0" />
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition Property="IsSelected" Value="false" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource Level0_NormalBrush}" />
                <Setter Property="IsExpanded" Value="false" />
                <Setter TargetName="imageToggleButton" Property="Visibility" Value="Collapsed" />
            </MultiTrigger>
            <!--  一级节点被选中，但失去键盘焦点  -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="0" />
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition Property="IsSelected" Value="true" />
                    <Condition Property="IsSelectionActive" Value="false" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource NodeLevel0_Clicked}" />
                <!--  <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />  -->
            </MultiTrigger>
            <!--  一级节点被选中，同时获得键盘焦点  -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="0" />
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition Property="IsSelected" Value="true" />
                    <Condition Property="IsSelectionActive" Value="true" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource NodeLevel0_GotFocus}" />
                <!--  <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />  -->
            </MultiTrigger>
            <!--  一级节点鼠标滑过  -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="0" />
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition SourceName="Bd" Property="IsMouseOver" Value="true" />
                    <Condition Property="IsSelected" Value="false" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource NodeLevel0_MouseOverBrush}" />
                <Setter TargetName="Expander" Property="Background" Value="{DynamicResource Expander_MouseOverBrush}" />
            </MultiTrigger>
            <!--  一级节点展开  -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="0" />
                    <Condition Property="IsExpanded" Value="true" />
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition Property="IsSelected" Value="true" />
                    <Condition Property="HasItems" Value="true" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource NodeLevel0_Clicked}" />
            </MultiTrigger>
            <!--  二级节点设置  -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition Property="NodeLevel" Value="1" />
                </MultiTrigger.Conditions>
                <Setter Property="Foreground" Value="White" />
                <Setter Property="FontWeight" Value="Normal" />
                <Setter TargetName="imageToggleButton" Property="Visibility" Value="Collapsed" />
                <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Level1TopBottom}" />
                <Setter TargetName="Bd" Property="BorderThickness" Value="0,1,0,1" />
                <!--
                    <Setter TargetName="InnerBd" Property="BorderBrush" Value="{DynamicResource LeftRightBrush}" />
                    <Setter TargetName="InnerBd" Property="BorderThickness" Value="1,0,1,0" />
                -->
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="1" />
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition Property="HasItems" Value="false" />
                </MultiTrigger.Conditions>
                <Setter TargetName="PART_Header" Property="Margin" Value="20,0,0,0" />
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="1" />
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition Property="HasItems" Value="true" />
                    <Condition Property="IsExpanded" Value="true" />
                </MultiTrigger.Conditions>
                <Setter TargetName="PART_Header" Property="Margin" Value="0" />
                <Setter TargetName="imageToggleButton" Property="Margin" Value="20,0,5,0" />
                <Setter TargetName="imageToggleButton" Property="Visibility" Value="Visible" />
                <Setter TargetName="imageToggleButton" Property="Background" Value="{DynamicResource Level1Expand}" />
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="1" />
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition Property="HasItems" Value="true" />
                    <Condition Property="IsExpanded" Value="false" />
                </MultiTrigger.Conditions>
                <Setter TargetName="PART_Header" Property="Margin" Value="0" />
                <Setter TargetName="imageToggleButton" Property="Margin" Value="20,0,5,0" />
                <Setter TargetName="imageToggleButton" Property="Visibility" Value="Visible" />
                <Setter TargetName="imageToggleButton" Property="Background" Value="{DynamicResource Level1NotExpand}" />
            </MultiTrigger>
            <!--  二级节点正常状态  -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="1" />
                    <Condition Property="IsSelected" Value="false" />
                    <Condition Property="StyleNumber" Value="0" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource Level1_NormalBrush}" />
            </MultiTrigger>
            <!--  二级节点被选中，但失去键盘焦点  -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="1" />
                    <Condition Property="IsSelected" Value="true" />
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition Property="IsSelectionActive" Value="false" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource NodeLevel1_Clicked}" />
            </MultiTrigger>
            <!--  二级节点被选中，同时获得键盘焦点  -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="1" />
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition Property="IsSelected" Value="true" />
                    <Condition Property="IsSelectionActive" Value="true" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource NodeLevel1_GotFocus}" />
            </MultiTrigger>
            <!--  二级节点鼠标滑过  -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="1" />
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition SourceName="Bd" Property="IsMouseOver" Value="true" />
                    <Condition Property="IsSelected" Value="false" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource NodeLevel1_MouseOverBrush}" />
            </MultiTrigger>
            <!--  二级节点展开  -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="1" />
                    <Condition Property="IsExpanded" Value="true" />
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition Property="IsSelected" Value="true" />
                    <Condition Property="HasItems" Value="true" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource NodeLevel1_Clicked}" />
            </MultiTrigger>
            <!--  三级节点设置  -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition Property="NodeLevel" Value="2" />
                </MultiTrigger.Conditions>
                <Setter Property="Foreground" Value="#010101" />
                <Setter Property="FontWeight" Value="Normal" />
                <Setter TargetName="imageToggleButton" Property="Visibility" Value="Collapsed" />
                <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Level2TopBottom}" />
                <Setter TargetName="Bd" Property="BorderThickness" Value="0,1,0,1" />
                <!--
                    <Setter TargetName="InnerBd" Property="BorderBrush" Value="{DynamicResource LeftRightBrush}" />
                    <Setter TargetName="InnerBd" Property="BorderThickness" Value="1,0,1,0" />
                -->
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="2" />
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition Property="HasItems" Value="false" />
                </MultiTrigger.Conditions>
                <Setter TargetName="PART_Header" Property="Margin" Value="35,0,0,0" />
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="2" />
                    <Condition Property="HasItems" Value="true" />
                    <Condition Property="StyleNumber" Value="0" />
                </MultiTrigger.Conditions>
                <Setter TargetName="PART_Header" Property="Margin" Value="0" />
                <Setter TargetName="imageToggleButton" Property="Visibility" Value="Visible" />
                <Setter TargetName="imageToggleButton" Property="Margin" Value="35,0,5,0" />
                <Setter TargetName="imageToggleButton" Property="Height" Value="8" />
                <Setter TargetName="imageToggleButton" Property="Width" Value="8" />
                <Setter TargetName="imageToggleButton" Property="Background" Value="{DynamicResource Level2Brush}" />
            </MultiTrigger>
            <!--  三级节点正常状态  -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="2" />
                    <Condition Property="IsSelected" Value="false" />
                    <Condition Property="StyleNumber" Value="0" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource Level2_NormalBrush}" />
            </MultiTrigger>
            <!--  三级节点被选中，但失去键盘焦点  -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="2" />
                    <Condition Property="IsSelected" Value="true" />
                    <Condition Property="IsSelectionActive" Value="false" />
                    <Condition Property="StyleNumber" Value="0" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource NodeLevel2_Clicked}" />
            </MultiTrigger>
            <!--  三级节点被选中，同时获得键盘焦点  -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="2" />
                    <Condition Property="IsSelected" Value="true" />
                    <Condition Property="IsSelectionActive" Value="true" />
                    <Condition Property="StyleNumber" Value="0" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource NodeLevel2_GotFocus}" />
            </MultiTrigger>
            <!--  三级节点鼠标滑过  -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="2" />
                    <Condition SourceName="Bd" Property="IsMouseOver" Value="true" />
                    <Condition Property="IsSelected" Value="false" />
                    <Condition Property="StyleNumber" Value="0" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource NodeLevel2_MouseOverBrush}" />
            </MultiTrigger>
            <!--  三级节点展开  -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="2" />
                    <Condition Property="IsExpanded" Value="true" />
                    <Condition Property="IsSelected" Value="true" />
                    <Condition Property="HasItems" Value="true" />
                    <Condition Property="StyleNumber" Value="0" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource NodeLevel2_Clicked}" />
            </MultiTrigger>
            <!--  交易节点设置  -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition Property="NodeLevel" Value="-1" />
                </MultiTrigger.Conditions>
                <Setter TargetName="imageToggleButton" Property="Background" Value="{DynamicResource TradeNotSelected}" />
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource Trade_NormalBrush}" />
                <Setter Property="FontWeight" Value="Normal" />
                <Setter TargetName="InnerBd" Property="BorderBrush" Value="{DynamicResource Level3TopBottom}" />
                <Setter TargetName="InnerBd" Property="BorderThickness" Value="0,1,0,1" />
                <!--
                    <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource LeftRightBrush}" />
                    <Setter TargetName="Bd" Property="BorderThickness" Value="1,0,1,0" />
                -->
                <Setter TargetName="imageToggleButton" Property="Height" Value="14" />
                <Setter Property="Foreground" Value="#010101" />
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition Property="IsSelected" Value="true" />
                    <Condition Property="NodeLevel" Value="-1" />
                </MultiTrigger.Conditions>
                <Setter TargetName="imageToggleButton" Property="Background" Value="{DynamicResource TradeSelected}" />
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="-1" />
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition Property="ParentLevel" Value="0" />
                </MultiTrigger.Conditions>
                <Setter TargetName="imageToggleButton" Property="Margin" Value="25,0,5,0" />
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="-1" />
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition Property="ParentLevel" Value="1" />
                </MultiTrigger.Conditions>
                <Setter TargetName="imageToggleButton" Property="Margin" Value="35,0,5,0" />
            </MultiTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="-1" />
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition Property="ParentLevel" Value="2" />
                </MultiTrigger.Conditions>
                <Setter TargetName="imageToggleButton" Property="Margin" Value="45,0,5,0" />
            </MultiTrigger>
            <!--  交易节点被选中，但失去键盘焦点  -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="-1" />
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition Property="IsSelected" Value="true" />
                    <Condition Property="IsSelectionActive" Value="false" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource Trade_Clicked}" />
            </MultiTrigger>
            <!--  交易节点被选中，同时获得键盘焦点  -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="-1" />
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition Property="IsSelected" Value="true" />
                    <Condition Property="IsSelectionActive" Value="true" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource Trade_GotFocus}" />
            </MultiTrigger>
            <!--  交易节点鼠标滑过  -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="-1" />
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition SourceName="Bd" Property="IsMouseOver" Value="true" />
                    <Condition Property="IsSelected" Value="false" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource Trade_MouseOverBrush}" />
            </MultiTrigger>
            <!--  交易节点展开  -->
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="NodeLevel" Value="-1" />
                    <Condition Property="StyleNumber" Value="0" />
                    <Condition Property="IsExpanded" Value="true" />
                    <Condition Property="IsSelected" Value="true" />
                    <Condition Property="HasItems" Value="true" />
                </MultiTrigger.Conditions>
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource Trade_Clicked}" />
            </MultiTrigger>
            <!--  Default Style End  -->
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Cursor" Value="Hand" />
            </Trigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsSelected" Value="true" />
                    <Condition Property="HasItems" Value="true" />
                </MultiTrigger.Conditions>
                <Setter Property="IsExpanded" Value="true" />
            </MultiTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style x:Key="ButtonStyle1" TargetType="{x:Type ToggleButton}">
        <Setter Property="Foreground" Value="White" />
        <!--  修改模板属性  -->
        <Setter Property="Template">
            <Setter.Value>
                <!--  控件模板  -->
                <ControlTemplate TargetType="{x:Type ToggleButton}">
                    <!--  背景色  -->
                    <Border x:Name="back" CornerRadius="3">
                        <Border.BitmapEffect>
                            <OuterGlowBitmapEffect GlowColor="{Binding (Control.Background).(SolidColorBrush.Color),
                                                                       RelativeSource={RelativeSource TemplatedParent}}"
                                                   GlowSize="0"
                                                   Opacity="0.7" />
                        </Border.BitmapEffect>
                        <Border.Background>
                            <LinearGradientBrush StartPoint="0,0" EndPoint="0,1.5">
                                <LinearGradientBrush.GradientStops>
                                    <GradientStopCollection>
                                        <GradientStop Offset="0" Color="{Binding (Control.Background).(SolidColorBrush.Color), RelativeSource={RelativeSource TemplatedParent}}" />
                                        <GradientStop Offset="0.4" Color="{Binding (Control.Background).(SolidColorBrush.Color), RelativeSource={RelativeSource TemplatedParent}}" />
                                        <GradientStop Offset="1" Color="#FFF" />
                                    </GradientStopCollection>
                                </LinearGradientBrush.GradientStops>
                            </LinearGradientBrush>
                        </Border.Background>
                        <!--  前景色及边框  -->
                        <Border x:Name="fore"
                                BorderBrush="#5555"
                                BorderThickness="1"
                                CornerRadius="3">
                            <Border.Background>
                                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                                    <LinearGradientBrush.GradientStops>
                                        <GradientStopCollection>
                                            <GradientStop Offset="0.5" Color="#6FFF" />
                                            <GradientStop Offset="0.51" Color="#1111" />
                                        </GradientStopCollection>
                                    </LinearGradientBrush.GradientStops>
                                </LinearGradientBrush>
                            </Border.Background>
                            <!--  按钮内容  -->
                            <ContentPresenter x:Name="content"
                                              HorizontalAlignment="Center"
                                              VerticalAlignment="Center"
                                              Content="{TemplateBinding Content}">
                                <ContentPresenter.BitmapEffect>
                                    <DropShadowBitmapEffect Direction="-90"
                                                            Opacity="0.3"
                                                            ShadowDepth="2"
                                                            Softness="0.1"
                                                            Color="#000" />
                                </ContentPresenter.BitmapEffect>
                            </ContentPresenter>
                        </Border>
                    </Border>
                    <!--  触发器  -->
                    <ControlTemplate.Triggers>
                        <!--  鼠标移入移出  -->
                        <Trigger Property="IsMouseOver" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.2"
                                                         Storyboard.TargetName="back"
                                                         Storyboard.TargetProperty="(UIElement.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)"
                                                         To="6" />
                                        <ColorAnimation BeginTime="0:0:0.2"
                                                        Duration="0:0:0.2"
                                                        Storyboard.TargetName="fore"
                                                        Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)"
                                                        To="#AFFF" />
                                        <ColorAnimation BeginTime="0:0:0.2"
                                                        Duration="0:0:0.2"
                                                        Storyboard.TargetName="fore"
                                                        Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                                        To="#3FFF" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.2"
                                                         Storyboard.TargetName="back"
                                                         Storyboard.TargetProperty="(UIElement.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />
                                        <ColorAnimation Duration="0:0:0.2"
                                                        Storyboard.TargetName="fore"
                                                        Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" />
                                        <ColorAnimation Duration="0:0:0.2"
                                                        Storyboard.TargetName="fore"
                                                        Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>
                        <!--  按钮按下弹起  -->
                        <Trigger Property="IsPressed" Value="True">
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.1"
                                                         Storyboard.TargetName="back"
                                                         Storyboard.TargetProperty="(UIElement.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)"
                                                         To="3" />
                                        <ColorAnimation Duration="0:0:0.1"
                                                        Storyboard.TargetName="fore"
                                                        Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)"
                                                        To="#3AAA" />
                                        <ColorAnimation Duration="0:0:0.1"
                                                        Storyboard.TargetName="fore"
                                                        Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                                        To="#2111" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.1"
                                                         Storyboard.TargetName="back"
                                                         Storyboard.TargetProperty="(UIElement.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />
                                        <ColorAnimation Duration="0:0:0.1"
                                                        Storyboard.TargetName="fore"
                                                        Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" />
                                        <ColorAnimation Duration="0:0:0.1"
                                                        Storyboard.TargetName="fore"
                                                        Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                        </Trigger>
                        <!--  按钮失效  -->
                        <Trigger Property="IsEnabled" Value="False">
                            <Trigger.EnterActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.3"
                                                         Storyboard.TargetName="back"
                                                         Storyboard.TargetProperty="(UIElement.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)"
                                                         To="0" />
                                        <DoubleAnimation Duration="0:0:0.1"
                                                         Storyboard.TargetName="content"
                                                         Storyboard.TargetProperty="(UIElement.BitmapEffect).(DropShadowBitmapEffect.Opacity)"
                                                         To="1" />
                                        <DoubleAnimation Duration="0:0:0.1"
                                                         Storyboard.TargetName="content"
                                                         Storyboard.TargetProperty="(UIElement.BitmapEffect).(DropShadowBitmapEffect.Direction)"
                                                         To="-135" />
                                        <ColorAnimation Duration="0:0:0.3"
                                                        Storyboard.TargetName="content"
                                                        Storyboard.TargetProperty="(UIElement.BitmapEffect).(DropShadowBitmapEffect.Color)"
                                                        To="#FFF" />
                                        <ColorAnimation Duration="0:0:0.3"
                                                        Storyboard.TargetName="fore"
                                                        Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)"
                                                        To="#D555" />
                                        <ColorAnimation Duration="0:0:0.3"
                                                        Storyboard.TargetName="fore"
                                                        Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)"
                                                        To="#CEEE" />
                                        <ColorAnimation Duration="0:0:0.3"
                                                        Storyboard.TargetName="fore"
                                                        Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)"
                                                        To="#CDDD" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <BeginStoryboard>
                                    <Storyboard>
                                        <DoubleAnimation Duration="0:0:0.1"
                                                         Storyboard.TargetName="back"
                                                         Storyboard.TargetProperty="(UIElement.BitmapEffect).(OuterGlowBitmapEffect.GlowSize)" />
                                        <DoubleAnimation Duration="0:0:0.1"
                                                         Storyboard.TargetName="content"
                                                         Storyboard.TargetProperty="(UIElement.BitmapEffect).(DropShadowBitmapEffect.Opacity)" />
                                        <DoubleAnimation Duration="0:0:0.1"
                                                         Storyboard.TargetName="content"
                                                         Storyboard.TargetProperty="(UIElement.BitmapEffect).(DropShadowBitmapEffect.Direction)" />
                                        <ColorAnimation Duration="0:0:0.1"
                                                        Storyboard.TargetName="content"
                                                        Storyboard.TargetProperty="(UIElement.BitmapEffect).(DropShadowBitmapEffect.Color)" />
                                        <ColorAnimation Duration="0:0:0.1"
                                                        Storyboard.TargetName="fore"
                                                        Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" />
                                        <ColorAnimation Duration="0:0:0.1"
                                                        Storyboard.TargetName="fore"
                                                        Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)" />
                                        <ColorAnimation Duration="0:0:0.1"
                                                        Storyboard.TargetName="fore"
                                                        Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[1].(GradientStop.Color)" />
                                    </Storyboard>
                                </BeginStoryboard>
                            </Trigger.ExitActions>
                            <Setter Property="Foreground" Value="#B444" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <PathGeometry x:Key="Checkmark" Figures="M0,2 L0,4.8 L2.5,7.4 L7.1,2.8 L7.1,0 L2.5,4.6 z" />
    <!--  交易节点  -->
    <ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Border x:Name="Bd"
                Background="{DynamicResource Trade_NormalBrush}"
                BorderBrush="{DynamicResource Level3TopBottom}"
                BorderThickness="{TemplateBinding BorderThickness}">
            <!--  修改了原来的BorderBrush TemplateBinding BorderBrush  -->
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"
                                      MinWidth="17"
                                      SharedSizeGroup="MenuItemIconColumnGroup" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIGTColumnGroup" />
                    <ColumnDefinition Width="14" />
                </Grid.ColumnDefinitions>
                <ContentPresenter x:Name="Icon"
                                  Margin="4,0,6,0"
                                  VerticalAlignment="Center"
                                  ContentSource="Icon" />
                <Path x:Name="GlyphPanel"
                      Margin="4,0,6,0"
                      VerticalAlignment="Center"
                      Data="{StaticResource Checkmark}"
                      Fill="{TemplateBinding Foreground}"
                      FlowDirection="LeftToRight"
                      Visibility="Hidden" />
                <ContentPresenter Grid.Column="1"
                                  Margin="{TemplateBinding Padding}"
                                  ContentSource="Header"
                                  RecognizesAccessKey="True" />
                <TextBlock x:Name="InputGestureText"
                           Grid.Column="2"
                           Margin="5,2,0,2"
                           DockPanel.Dock="Right"
                           FontWeight="Normal"
                           Foreground="#010101"
                           Text="{TemplateBinding InputGestureText}" />
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="Icon" Value="{x:Null}">
                <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
            </Trigger>
            <Trigger Property="IsChecked" Value="true">
                <Setter TargetName="GlyphPanel" Property="Visibility" Value="Visible" />
                <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
            </Trigger>
            <Trigger Property="IsHighlighted" Value="true">
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource Trade_NormalBrush}" />
                <!--  {DynamicResource {x:Static SystemColors.HighlightBrushKey}}  -->
                <Setter Property="Foreground" Value="#010101" />
                <!--  {DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}  -->
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Foreground" Value="#010101" />
                <!--  {DynamicResource {x:Static SystemColors.GrayTextBrushKey}}  -->
            </Trigger>
            <Trigger SourceName="Bd" Property="IsMouseOver" Value="true">

                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource Trade_MouseOverBrush}" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Geometry x:Key="UpArrow">M 0,4 L 3.5,0 L 7,4 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}">
                    <Microsoft_Windows_Themes:ClassicBorderDecorator x:Name="ClassicBorder"
                                                                     Background="{TemplateBinding Background}"
                                                                     BorderBrush="{x:Static Microsoft_Windows_Themes:ClassicBorderDecorator.ClassicBorderBrush}"
                                                                     BorderStyle="None"
                                                                     BorderThickness="1">
                        <ContentPresenter Margin="1"
                                          HorizontalAlignment="Center"
                                          VerticalAlignment="Center" />
                    </Microsoft_Windows_Themes:ClassicBorderDecorator>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsPressed" Value="true">
                            <Setter TargetName="ClassicBorder" Property="BorderStyle" Value="ThinPressed" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <MenuScrollingVisibilityConverter x:Key="MenuScrollingVisibilityConverter" />
    <Geometry x:Key="DownArrow">M 0,0 L 3.5,4 L 7,0 Z</Geometry>
    <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>
                        <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=TopLevelHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Microsoft_Windows_Themes:ClassicBorderDecorator x:Name="ClassicBorder"
                                                         Background="{TemplateBinding Background}"
                                                         BorderBrush="{x:Static Microsoft_Windows_Themes:ClassicBorderDecorator.ClassicBorderBrush}"
                                                         BorderStyle="None"
                                                         BorderThickness="0">
            <DockPanel>
                <ContentPresenter x:Name="Icon"
                                  Margin="4,0,6,0"
                                  VerticalAlignment="Center"
                                  ContentSource="Icon" />
                <Path x:Name="GlyphPanel"
                      Margin="4,0,6,0"
                      VerticalAlignment="Center"
                      Data="{StaticResource Checkmark}"
                      Fill="{TemplateBinding Foreground}"
                      FlowDirection="LeftToRight"
                      Visibility="Collapsed" />
                <ContentPresenter Margin="{TemplateBinding Padding}"
                                  ContentSource="Header"
                                  RecognizesAccessKey="True" />
                <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}}">
                    <Microsoft_Windows_Themes:SystemDropShadowChrome x:Name="Shdw" Color="Transparent">
                        <Microsoft_Windows_Themes:ClassicBorderDecorator x:Name="SubMenuBorder"
                                                                         Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
                                                                         BorderBrush="{x:Static Microsoft_Windows_Themes:ClassicBorderDecorator.ClassicBorderBrush}"
                                                                         BorderStyle="AltRaised"
                                                                         BorderThickness="2">
                            <ScrollViewer x:Name="SubMenuScrollViewer"
                                          CanContentScroll="true"
                                          Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer,
                                                                                        TypeInTargetAssembly={x:Type FrameworkElement}}}">
                                <Grid RenderOptions.ClearTypeHint="Enabled">
                                    <Canvas Width="0"
                                            Height="0"
                                            HorizontalAlignment="Left"
                                            VerticalAlignment="Top">
                                        <Rectangle Width="{Binding ActualWidth,
                                                                   ElementName=SubMenuBorder}"
                                                   Height="{Binding ActualHeight,
                                                                    ElementName=SubMenuBorder}"
                                                   Fill="{Binding Background,
                                                                  ElementName=SubMenuBorder}" />
                                    </Canvas>
                                    <ItemsPresenter x:Name="ItemsPresenter"
                                                    Grid.IsSharedSizeScope="true"
                                                    KeyboardNavigation.DirectionalNavigation="Cycle"
                                                    KeyboardNavigation.TabNavigation="Cycle" />
                                </Grid>
                            </ScrollViewer>
                        </Microsoft_Windows_Themes:ClassicBorderDecorator>
                    </Microsoft_Windows_Themes:SystemDropShadowChrome>
                </Popup>
            </DockPanel>
        </Microsoft_Windows_Themes:ClassicBorderDecorator>
        <ControlTemplate.Triggers>
            <Trigger Property="IsSuspendingPopupAnimation" Value="true">
                <Setter TargetName="PART_Popup" Property="PopupAnimation" Value="None" />
            </Trigger>
            <Trigger Property="Icon" Value="{x:Null}">
                <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
            </Trigger>
            <Trigger Property="IsChecked" Value="true">
                <Setter TargetName="GlyphPanel" Property="Visibility" Value="Visible" />
                <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
            </Trigger>
            <Trigger Property="IsHighlighted" Value="true">
                <Setter TargetName="ClassicBorder" Property="BorderStyle" Value="ThinRaised" />
            </Trigger>
            <Trigger Property="IsKeyboardFocused" Value="true">
                <Setter TargetName="ClassicBorder" Property="BorderStyle" Value="ThinPressed" />
            </Trigger>
            <Trigger Property="IsSubmenuOpen" Value="true">
                <Setter TargetName="ClassicBorder" Property="BorderStyle" Value="ThinPressed" />
            </Trigger>
            <Trigger SourceName="PART_Popup" Property="HasDropShadow" Value="true">
                <Setter TargetName="Shdw" Property="Margin" Value="0,0,5,5" />
                <Setter TargetName="Shdw" Property="Color" Value="#71000000" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <ControlTemplate x:Key="{ComponentResourceKey ResourceId=TopLevelItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Microsoft_Windows_Themes:ClassicBorderDecorator x:Name="ClassicBorder"
                                                         Background="{TemplateBinding Background}"
                                                         BorderBrush="{x:Static Microsoft_Windows_Themes:ClassicBorderDecorator.ClassicBorderBrush}"
                                                         BorderStyle="None"
                                                         BorderThickness="1">
            <DockPanel x:Name="ContentPanel">
                <ContentPresenter x:Name="Icon"
                                  Margin="4,0,6,0"
                                  VerticalAlignment="Center"
                                  ContentSource="Icon" />
                <Path x:Name="GlyphPanel"
                      Margin="4,0,6,0"
                      VerticalAlignment="Center"
                      Data="{StaticResource Checkmark}"
                      Fill="{TemplateBinding Foreground}"
                      FlowDirection="LeftToRight"
                      Visibility="Collapsed" />
                <ContentPresenter Margin="{TemplateBinding Padding}"
                                  ContentSource="Header"
                                  RecognizesAccessKey="True" />
            </DockPanel>
        </Microsoft_Windows_Themes:ClassicBorderDecorator>
        <ControlTemplate.Triggers>
            <Trigger Property="Icon" Value="{x:Null}">
                <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
            </Trigger>
            <Trigger Property="IsChecked" Value="true">
                <Setter TargetName="GlyphPanel" Property="Visibility" Value="Visible" />
                <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
            </Trigger>
            <Trigger Property="IsHighlighted" Value="true">
                <Setter TargetName="ClassicBorder" Property="BorderStyle" Value="ThinRaised" />
            </Trigger>
            <Trigger Property="IsKeyboardFocused" Value="true">
                <Setter TargetName="ClassicBorder" Property="BorderStyle" Value="ThinPressed" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Geometry x:Key="RightArrow">M 0,0 L 4,3.5 L 0,7 Z</Geometry>
    <ControlTemplate x:Key="{ComponentResourceKey ResourceId=SubmenuHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}" TargetType="{x:Type MenuItem}">
        <Border x:Name="Bd"
                Background="{DynamicResource Level1_NormalBrush}"
                BorderBrush="{DynamicResource Level1TopBottom}"
                BorderThickness="{TemplateBinding BorderThickness}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"
                                      MinWidth="17"
                                      SharedSizeGroup="MenuItemIconColumnGroup" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIGTColumnGroup" />
                    <ColumnDefinition Width="14" />
                </Grid.ColumnDefinitions>
                <ContentPresenter x:Name="Icon"
                                  Margin="4,0,6,0"
                                  VerticalAlignment="Center"
                                  ContentSource="Icon" />
                <Path x:Name="GlyphPanel"
                      Margin="4,0,6,0"
                      VerticalAlignment="Center"
                      Data="{StaticResource Checkmark}"
                      Fill="{TemplateBinding Foreground}"
                      FlowDirection="LeftToRight"
                      Visibility="Hidden" />
                <ContentPresenter Grid.Column="1"
                                  Margin="{TemplateBinding Padding}"
                                  ContentSource="Header"
                                  RecognizesAccessKey="True" />
                <Path x:Name="ArrowPanel"
                      Grid.Column="3"
                      Margin="4,0,6,0"
                      VerticalAlignment="Center"
                      Data="{StaticResource RightArrow}"
                      DockPanel.Dock="Right"
                      Fill="{TemplateBinding Foreground}" />
                <Popup x:Name="PART_Popup"
                       AllowsTransparency="true"
                       Focusable="false"
                       IsOpen="{Binding IsSubmenuOpen,
                                        RelativeSource={RelativeSource TemplatedParent}}"
                       Placement="Right"
                       PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}"
                       VerticalOffset="-2">
                    <Microsoft_Windows_Themes:SystemDropShadowChrome x:Name="Shdw" Color="Transparent">
                        <Microsoft_Windows_Themes:ClassicBorderDecorator x:Name="SubMenuBorder"
                                                                         Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"
                                                                         BorderBrush="{x:Static Microsoft_Windows_Themes:ClassicBorderDecorator.ClassicBorderBrush}"
                                                                         BorderStyle="AltRaised"
                                                                         BorderThickness="2">
                            <ScrollViewer x:Name="SubMenuScrollViewer"
                                          CanContentScroll="true"
                                          Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer,
                                                                                        TypeInTargetAssembly={x:Type FrameworkElement}}}">
                                <Grid RenderOptions.ClearTypeHint="Enabled">
                                    <Canvas Width="0"
                                            Height="0"
                                            HorizontalAlignment="Left"
                                            VerticalAlignment="Top">
                                        <Rectangle Width="{Binding ActualWidth,
                                                                   ElementName=SubMenuBorder}"
                                                   Height="{Binding ActualHeight,
                                                                    ElementName=SubMenuBorder}"
                                                   Fill="{Binding Background,
                                                                  ElementName=SubMenuBorder}" />
                                    </Canvas>
                                    <ItemsPresenter x:Name="ItemsPresenter"
                                                    Grid.IsSharedSizeScope="true"
                                                    KeyboardNavigation.DirectionalNavigation="Cycle"
                                                    KeyboardNavigation.TabNavigation="Cycle" />
                                </Grid>
                            </ScrollViewer>
                        </Microsoft_Windows_Themes:ClassicBorderDecorator>
                    </Microsoft_Windows_Themes:SystemDropShadowChrome>
                </Popup>
            </Grid>
        </Border>
        <ControlTemplate.Triggers>
            <Trigger Property="IsSuspendingPopupAnimation" Value="true">
                <Setter TargetName="PART_Popup" Property="PopupAnimation" Value="None" />
            </Trigger>
            <Trigger Property="Icon" Value="{x:Null}">
                <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
            </Trigger>
            <Trigger Property="IsChecked" Value="true">
                <Setter TargetName="GlyphPanel" Property="Visibility" Value="Visible" />
                <Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
            </Trigger>
            <Trigger Property="IsHighlighted" Value="true">
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource Level1_NormalBrush}" />
                <!--  "{DynamicResource {x:Static SystemColors.HighlightBrushKey}}"  -->
                <Setter Property="Foreground" Value="#010101" />
                <!--  {DynamicResource {x:Static SystemColors.HighlightTextBrushKey}}  -->
            </Trigger>
            <Trigger SourceName="PART_Popup" Property="HasDropShadow" Value="true">
                <Setter TargetName="Shdw" Property="Margin" Value="0,0,5,5" />
                <Setter TargetName="Shdw" Property="Color" Value="#71000000" />
            </Trigger>
            <Trigger Property="IsEnabled" Value="false">
                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Cursor" Value="Hand" />
                <Setter TargetName="Bd" Property="Background" Value="{DynamicResource NodeLevel1_MouseOverBrush}" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style x:Key="MenuItemStyle1" TargetType="{x:Type local:MultilevelMenuItemBase}">
        <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="{DynamicResource Level0_NormalBrush}" />
        <!--    -->
        <Setter Property="BorderBrush" Value="{DynamicResource Level0TopBottom}" />
        <Setter Property="Foreground" Value="White" />
        <Setter Property="FontWeight" Value="Bold" />
        <!--  {DynamicResource {x:Static SystemColors.MenuTextBrushKey}}  -->
        <Setter Property="ScrollViewer.PanningMode" Value="Both" />
        <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
        <Setter Property="Height" Value="28" />
        <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=SubmenuItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}" />
        <Style.Triggers>
            <Trigger Property="Role" Value="TopLevelHeader">
                <Setter Property="Margin" Value="0,1,0,1" />
                <Setter Property="Padding" Value="4,1,5,2" />
                <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=TopLevelHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}" />
            </Trigger>
            <Trigger Property="Role" Value="TopLevelItem">
                <Setter Property="Margin" Value="0,1,0,1" />
                <Setter Property="Padding" Value="4,1,5,2" />
                <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=TopLevelItemTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}" />
            </Trigger>
            <Trigger Property="Role" Value="SubmenuHeader">
                <Setter Property="DockPanel.Dock" Value="Top" />
                <Setter Property="Padding" Value="0,2,0,2" />
                <Setter Property="Template" Value="{DynamicResource {ComponentResourceKey ResourceId=SubmenuHeaderTemplateKey, TypeInTargetAssembly={x:Type MenuItem}}}" />
            </Trigger>
            <Trigger Property="Role" Value="SubmenuItem">
                <Setter Property="DockPanel.Dock" Value="Top" />
                <Setter Property="Padding" Value="0,2,0,2" />
            </Trigger>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Background" Value="{DynamicResource NodeLevel0_MouseOverBrush}" />
                <Setter Property="Foreground" Value="#010101" />
                <Setter Property="FontWeight" Value="Normal" />
                <Setter Property="Cursor" Value="Hand" />
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="MenuStyle1" TargetType="{x:Type local:MultilevelMenu}">
        <Setter Property="Background" Value="{DynamicResource MainPage_MenuTreeArea}" />
        <!--  {DynamicResource {x:Static SystemColors.MenuBrushKey}}  -->
        <Setter Property="FontFamily" Value="{DynamicResource {x:Static SystemFonts.MenuFontFamilyKey}}" />
        <Setter Property="FontSize" Value="{DynamicResource {x:Static SystemFonts.MenuFontSizeKey}}" />
        <Setter Property="FontStyle" Value="{DynamicResource {x:Static SystemFonts.MenuFontStyleKey}}" />
        <Setter Property="FontWeight" Value="{DynamicResource {x:Static SystemFonts.MenuFontWeightKey}}" />
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.MenuTextBrushKey}}" />
        <Setter Property="VerticalContentAlignment" Value="Center" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:MultilevelMenu}">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            Padding="{TemplateBinding Padding}">
                        <StackPanel>

                            <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                        </StackPanel>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>

    </Style>
</ResourceDictionary>