<fw:BaseWindow x:Class="Com.FirmLib.UI.Manufacturer.WinProductList"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:Com.FirmLib.UI.Manufacturer"
             xmlns:fw="http://schemas.FWind/xaml"
             xmlns:uc="clr-namespace:Com.FirmLib.UI.Common"
             xmlns:dgx="urn:tom-englert.de/DataGridExtensions"
             Title="产品名录"
               Name="this"
             Height="550" Width="500" WindowStartupLocation="CenterOwner">
   <fw:BaseWindow.Resources>
        <fw:BindingProxy x:Key="DATA" Data="{Binding}"></fw:BindingProxy>
        <Style TargetType="DataGridRow">
            <Setter Property="Height" Value="30"></Setter>
            <Style.Triggers>
                <Trigger Property="ItemsControl.AlternationIndex"
                             Value="0">
                    <Setter Property="Background" Value="White" />
                </Trigger>
                <Trigger Property="ItemsControl.AlternationIndex"
                             Value="1">
                    <Setter Property="Background" Value="#FFE6E3DD" />
                </Trigger>
            </Style.Triggers>
        </Style>
    </fw:BaseWindow.Resources>

    <Grid Margin="5">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition></RowDefinition>
        </Grid.RowDefinitions>
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <DataGrid x:Name="BrandGrid" Grid.Column="0" BorderThickness="1" BorderBrush="Black"  AutoGenerateColumns="False" SelectionMode="Single"  FrozenColumnCount="1" ItemsSource="{Binding Root.Items}" SelectedItem="{Binding Root.CurrentItem}"
                  CanUserAddRows="False"
                  CanUserDeleteRows="False"
                  VerticalScrollBarVisibility="Auto"
                  HorizontalScrollBarVisibility="Auto"
                  SelectionUnit="FullRow"
                  HeadersVisibility="Column" 
                  CanUserSortColumns="False"   
                      dgx:DataGridFilter.IsAutoFilterEnabled="True"
                  CellStyle="{StaticResource ResourceKey={x:Static uc:CommonStyles.DataGridCellKey}}"
                  AlternationCount="2">
                <DataGrid.Columns>
                    <fw:TDataGridTextColumn Width="*" Header="品牌名" Binding="{Binding RefItem.Name}" IsReadOnly="True"></fw:TDataGridTextColumn>
                </DataGrid.Columns>

            </DataGrid>

            <DataGrid x:Name="ProductGrid" Grid.Column="1" BorderThickness="1" BorderBrush="Black"   AutoGenerateColumns="False" SelectionMode="Single"  FrozenColumnCount="1" ItemsSource="{Binding Root.CurrentItem.Nodes}" SelectedItem="{Binding Root.CurrentItem.CurrentItem}"
                  CanUserAddRows="False"
                  CanUserDeleteRows="False"
                  VerticalScrollBarVisibility="Auto"
                  HorizontalScrollBarVisibility="Auto"
                  SelectionUnit="FullRow"
                  HeadersVisibility="Column" 
                  CanUserSortColumns="True"   
                  CellStyle="{StaticResource ResourceKey={x:Static uc:CommonStyles.DataGridCellKey}}"
                  AlternationCount="2">
                <DataGrid.Columns>
                    <fw:TDataGridTextColumn Width="*" Header="产品名" Binding="{Binding RefItem.Name}" IsReadOnly="True"></fw:TDataGridTextColumn>
                </DataGrid.Columns>
            </DataGrid>

            <Grid Grid.Column="2">
                <Grid.RowDefinitions>
                    <RowDefinition></RowDefinition>
                </Grid.RowDefinitions>

                <DataGrid x:Name="ProductTypeGrid" Grid.Row="0" BorderThickness="1" BorderBrush="Black"  AutoGenerateColumns="False" SelectionMode="Single"  FrozenColumnCount="1" ItemsSource="{Binding Root.CurrentItem.CurrentItem.Nodes}" SelectedItem="{Binding Root.CurrentItem.CurrentItem.CurrentItem,Mode=OneWay}"
                      CanUserAddRows="False"
                      CanUserDeleteRows="False"
                      VerticalScrollBarVisibility="Auto"
                      HorizontalScrollBarVisibility="Auto"
                      SelectionUnit="FullRow"
                      HeadersVisibility="Column" 
                      CanUserSortColumns="False"   
                      CellStyle="{StaticResource ResourceKey={x:Static uc:CommonStyles.DataGridCellKey}}"
                      AlternationCount="2">
                    <DataGrid.Columns>
                        <fw:TDataGridTextColumn Width="*" Header="型号" Binding="{Binding RefItem.Name}" IsReadOnly="True" ></fw:TDataGridTextColumn>
                    </DataGrid.Columns>
                  
                </DataGrid>

           
            </Grid>

        </Grid>
    </Grid>
</fw:BaseWindow>
