<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"
                    x:Class="Controls.MenuOrTreeView">

    <Style TargetType="{x:Type local:MenuOrTreeView}">
        <Style.Triggers>
            <Trigger Property="TemplateType" Value="TreeViewList1">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type local:MenuOrTreeView}">
                            <local:TreeViewList Name="Commontradetree"
                                       Width="{TemplateBinding Width}"
                                       Background="{DynamicResource MainPage_MenuTreeArea}"
                                        ItemsSource="{TemplateBinding ItemsSource}" StyleNumber="0" >
                            </local:TreeViewList>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="TemplateType" Value="TreeViewList2">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type local:MenuOrTreeView}">
                            <local:TreeViewList Name="Commontradetree"
                                       Width="{TemplateBinding Width}"
                                       Background="{DynamicResource MainPage_MenuTreeArea}"
                                        ItemsSource="{TemplateBinding ItemsSource}" StyleNumber="1"/>

                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="TemplateType" Value="TreeViewList3">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type local:MenuOrTreeView}">
                            <local:TreeViewList Name="Commontradetree"
                                       Width="{TemplateBinding Width}"
                                       Background="{DynamicResource MainPage_MenuTreeArea}"
                                        ItemsSource="{TemplateBinding ItemsSource}" StyleNumber="2"/>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
            <Trigger Property="TemplateType" Value="MenuList">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type local:MenuOrTreeView}">
                            <local:MultilevelMenu Name="MultilevelMenu"
                                                                     Width="{Binding ElementName=Commontradetree,
                                                                                     Path=Width}"
                                                                     Background="{DynamicResource MainPage_MenuTreeArea}"
                                                 ItemsSource="{TemplateBinding MenuItemsSource}"
                                                                     Style="{DynamicResource MenuStyle1}" ItemContainerStyle="{DynamicResource MenuItemStyle1}">
                                <local:MultilevelMenu.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <StackPanel Background="{DynamicResource Level0_NormalBrush}" IsItemsHost="True" />
                                    </ItemsPanelTemplate>
                                </local:MultilevelMenu.ItemsPanel>
                            </local:MultilevelMenu>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>
    </Style>



</ResourceDictionary>