<Window x:Class="SlnMesnac.WPF.Page.IndexPage.DetailTaskContent"
        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:SlnMesnac.WPF.Page.IndexPage"
        mc:Ignorable="d" 
        Height="650" Width="1020" WindowStartupLocation="CenterScreen" Loaded="Window_Loaded">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="6*"/>
            <RowDefinition Height="60*"/>
        </Grid.RowDefinitions>
        <Border Grid.Row="0" Margin="0,5,0,0" BorderBrush="#007DFA" BorderThickness="1" CornerRadius="0" Background="#1254AB">
            <StackPanel Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center">
                <TextBlock Name="AreaTask" Text="1号站台任务列表" FontSize="30" Foreground="White"  Height="37" Width="249"/>
            </StackPanel>
        </Border>

        <Border Grid.Row="1" Margin="0,5,0,0" BorderBrush="#007DFA" BorderThickness="1" CornerRadius="0" Background="#1254AB">
            <DataGrid x:Name="AreaTaskDataGrid" Style="{DynamicResource DataGridStyle}"   ColumnHeaderHeight="22" RowHeight="40" AutoGenerateColumns="False" RowHeaderWidth="0" GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden" ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="0">
                <DataGrid.Resources>
                    <Style x:Key="DataGridStyle" TargetType="DataGrid">
                        <Setter Property="AlternationCount" Value="2"/>
                        <Setter Property="ColumnHeaderStyle" Value="{DynamicResource DataGridColumnHeaderStyle}"/>
                        <Setter Property="CellStyle" Value="{DynamicResource DataGridCellStyle}"/>
                        <Setter Property="RowStyle" Value="{DynamicResource DataGridRowStyle}"/>
                    </Style>
                    <Style x:Key="DataGridColumnHeaderStyle" TargetType="DataGridColumnHeader">
                        <Setter Property="HorizontalContentAlignment" Value="Center"/>
                        <Setter Property="VerticalContentAlignment" Value="Center"/>
                        <Setter Property="Background" Value="White"/>
                    </Style>
                    <Style x:Key="DataGridRowStyle" TargetType="{x:Type DataGridRow}">
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type DataGridRow}">
                                    <Grid x:Name="DGR_Border" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
                                        <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1"/>
                                        <DataGridCellsPresenter Grid.Column="1" ItemsPanel="{TemplateBinding ItemsPanel}"/>
                                    </Grid>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="IsSelected" Value="True">
                                            <Setter Property="BorderBrush" Value="#00BCD4"/>
                                        </Trigger>
                                        <Trigger Property="AlternationIndex" Value="0">
                                            <Setter Property="Background" Value="#E9F3FD"/>
                                        </Trigger>
                                    </ControlTemplate.Triggers>

                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                        <Style.Triggers>
                            <Trigger Property="IsNewItem" Value="True">
                                <Setter Property="Margin" Value="{Binding NewItemMargin, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
                            </Trigger>
                        </Style.Triggers>
                    </Style>
                    <Style x:Key="DataGridCellStyle" TargetType="{x:Type DataGridCell}">
                        <Setter Property="Background" Value="Transparent"/>
                        <Setter Property="BorderBrush" Value="Transparent"/>
                        <Setter Property="BorderThickness" Value="0"/>
                        <Setter Property="VerticalContentAlignment" Value="Center"/>
                        <Setter Property="HorizontalContentAlignment" Value="Center"/>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="{x:Type DataGridCell}">
                                    <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" SnapsToDevicePixels="True">
                                        <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                                    </Border>
                                    <ControlTemplate.Triggers>
                                        <Trigger Property="IsSelected" Value="True">
                                            <Setter Property="Foreground" Value="Gray"/>
                                        </Trigger>
                                    </ControlTemplate.Triggers>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style>
                </DataGrid.Resources>
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding id}" Header="编号" Width="60"/>
                    <!--<DataGridTextColumn Binding="{Binding MachineID}" Header="机台编号" Width="60"/>-->
                    <DataGridTextColumn Binding="{Binding taskno}" Header="任务编号" Width="*"/>
                    <DataGridTextColumn Binding="{Binding flightno}" Header="航班号" Width="*"/>
                    <DataGridTextColumn Binding="{Binding agvno}" Header="AGV" Width="0.6*"/>
                    <DataGridTextColumn Binding="{Binding manipulatorno}" Header="AMR" Width="0.6*"/>
                    <DataGridTextColumn Binding="{Binding taskstate}" Header="任务状态" Width="*"/>
                    <DataGridTextColumn Binding="{Binding totalcount}" Header="总抓取数量" Width="*"/>
                    <DataGridTextColumn Binding="{Binding loadcount}" Header="已抓取数量" Width="*"/>
                    <DataGridTextColumn Binding="{Binding starttime,StringFormat=\{0:yyyy-MM-dd HH:mm:ss\}}" Header="开始时间" Width="*"/>
                    <DataGridTextColumn Binding="{Binding finishtime,StringFormat=\{0:yyyy-MM-dd HH:mm:ss\}}" Header="完成时间" Width="*"/>
                </DataGrid.Columns>
            </DataGrid>
        </Border>

    </Grid>
</Window>
