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

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/Platform.Controls;component/Themes/MenuTreeItemControlTemplate.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style x:Key="{x:Type TreeViewItem}" TargetType="{x:Type local:TreeViewListItem}">
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="HorizontalContentAlignment" Value="{Binding Path=HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
        <Setter Property="VerticalContentAlignment" Value="{Binding Path=VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
        <Setter Property="Padding" Value="1,0,0,0" />
        <Setter Property="Margin" Value="0,-1,0,0" />
        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate 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>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="StyleNumber" Value="1">
                <Setter Property="Template" Value="{StaticResource StyleNumber1}" />
            </Trigger>
            <Trigger Property="StyleNumber" Value="2">
                <Setter Property="Template" Value="{StaticResource StyleNumber2}" />
            </Trigger>
            <Trigger Property="StyleNumber" Value="0">
                <Setter Property="Template" Value="{StaticResource StyleNumber0}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style TargetType="{x:Type local:TreeViewList}">
        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
        <Setter Property="SnapsToDevicePixels" Value="True" />
        <Setter Property="ItemContainerStyle" Value="{StaticResource {x:Type TreeViewItem}}" />
        <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
        <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:TreeViewList}">
                    <Border Name="Border"
                            Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}"
                            CornerRadius="1">
                        <Grid>
                            <ScrollViewer CanContentScroll="False"
                                          Focusable="False"
                                          HorizontalScrollBarVisibility="Auto"
                                          Padding="0"
                                          VerticalScrollBarVisibility="Auto">
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto" />
                                        <RowDefinition Height="*" />
                                    </Grid.RowDefinitions>
                                    <ItemsPresenter Grid.Row="1"
                                                    Margin="-1,10,-1,0"
                                                    HorizontalAlignment="Left"
                                                    Visibility="{Binding Path=ItemsVisibility,
                                                                         RelativeSource={RelativeSource TemplatedParent}}" />
                                </Grid>
                            </ScrollViewer>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>