<fw:NChildWindow x:Class="Com.FirmLib.UI.Manufacturer.WinProjectAssetList"
             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:fw="http://schemas.FWind/xaml"
             xmlns:uc="clr-namespace:Com.FirmLib.UI.Common"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             xmlns:behaviors="clr-namespace:FWindSoft.Wpf.Behaviors;assembly=FWindSoft.Wpf"
             xmlns:dgx="urn:tom-englert.de/DataGridExtensions"
             mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="500" Title="项目资产清单" Height="{Binding Height,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UIElement}}"
                 Width="{Binding ActualWidth,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ScrollContentPresenter}}">
    <fw:NChildWindow.Resources>
        <fw:BindingProxy x:Key="DATA" Data="{Binding}"></fw:BindingProxy>
    </fw:NChildWindow.Resources>
    <Grid Margin="5">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition></RowDefinition>
        </Grid.RowDefinitions>


        <DataGrid Grid.Row="1" Grid.Column="0"   AutoGenerateColumns="False" SelectionMode="Single"  FrozenColumnCount="1" ItemsSource="{Binding AssetItems,UpdateSourceTrigger=PropertyChanged}"
                CanUserAddRows="False"
                CanUserDeleteRows="False"
                VerticalScrollBarVisibility="Auto"
                HorizontalScrollBarVisibility="Auto"
                SelectionUnit="FullRow"
                HeadersVisibility="Column" 
                CanUserSortColumns="True"   
                  dgx:DataGridFilter.IsAutoFilterEnabled="True"
                CellStyle="{StaticResource ResourceKey={x:Static uc:CommonStyles.DataGridCellKey}}"
                  AlternationCount="2"
                >
           <DataGrid.RowStyle>
              
                <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>
            </DataGrid.RowStyle>
            <DataGrid.Columns>
                <DataGridTemplateColumn Header="操作"  Width="110" IsReadOnly="True" >
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Button Command="{Binding Data.Commands.ScanAssetInfo,Source={StaticResource ResourceKey=DATA} }" CommandParameter="{Binding}" Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.LinkButtonKey}}" HorizontalAlignment="Left"   Content="查看资产详情" Padding="5,0,5,0"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>

                </DataGridTemplateColumn>
                <fw:TDataGridTextColumn Header="本地名称" Width="100" IsReadOnly="True"  Binding="{Binding Path=LocalName}"></fw:TDataGridTextColumn>
                <fw:TDataGridTextColumn Header="本地编码"  Width="100" IsReadOnly="True"  Binding="{Binding Path=LocalCode}"></fw:TDataGridTextColumn>

                <fw:TDataGridTextColumn Header="品牌"  Width="100" IsReadOnly="True"  Binding="{Binding Path=Brand}"></fw:TDataGridTextColumn>
                <fw:TDataGridTextColumn Header="产品名"  Width="100" IsReadOnly="True"  Binding="{Binding Path=Product}"></fw:TDataGridTextColumn>
                <fw:TDataGridTextColumn Header="型号"  Width="100" IsReadOnly="True"  Binding="{Binding Path=Type}"></fw:TDataGridTextColumn>
                
                <!--<DataGridTemplateColumn Header="设备正面照"  Width="60" IsReadOnly="True" >
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Button Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.ButtonKey}}"   Content="查看资产详情"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>

                </DataGridTemplateColumn>
                <DataGridTemplateColumn Header="设备名牌照"  Width="60" IsReadOnly="True" >
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <Button Style="{StaticResource ResourceKey={x:Static uc:CommonStyles.ButtonKey}}"   Content="查看资产详情"/>
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>

                </DataGridTemplateColumn>-->
                <fw:TDataGridTextColumn Header="生产日期"  Width="100" IsReadOnly="True"  Binding="{Binding Path=ManufactureDate}"></fw:TDataGridTextColumn>
                <fw:TDataGridTextColumn Header="出厂编号"  Width="100" IsReadOnly="True"  Binding="{Binding Path=LeaveFactoryCode}"></fw:TDataGridTextColumn>
            </DataGrid.Columns>
            <i:Interaction.Behaviors>
                <behaviors:GridCellSingleClickEditBehavior></behaviors:GridCellSingleClickEditBehavior>
            </i:Interaction.Behaviors>

        </DataGrid>
    </Grid>
</fw:NChildWindow>

