<pi:UserControlBase xmlns:pi="https://github.com/ping9719/wpfex"
                    x:Class="智慧物流软件系统.AGVTaskView"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:hc="https://handyorg.github.io/handycontrol"
                    mc:Ignorable="d"
                    d:DesignHeight="737"
                    d:DesignWidth="1192"
                    LoadedVisibleFirst="LoadedVisible">
    <Border Margin="0"
            Background="AliceBlue"
            CornerRadius="3"
            Padding="0">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="2*"></RowDefinition>
                <RowDefinition Height="12*"></RowDefinition>
            </Grid.RowDefinitions>
            <Border Grid.Row="0"
                    Margin="5 5 5 0"
                    Background="AliceBlue"
                    CornerRadius="5"
                    Padding="0">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="2*"></ColumnDefinition>
                        <ColumnDefinition Width="2*"></ColumnDefinition>
                        <ColumnDefinition Width="2*"></ColumnDefinition>
                        <ColumnDefinition Width="2.2*"></ColumnDefinition>
                        <ColumnDefinition Width="1.8*"></ColumnDefinition>
                        <ColumnDefinition Width="2*"></ColumnDefinition>
                        <ColumnDefinition Width="1.8*"></ColumnDefinition>
                        <ColumnDefinition Width="2*"></ColumnDefinition>
                        <ColumnDefinition Width="2*"></ColumnDefinition>
                        <ColumnDefinition Width="2*"></ColumnDefinition>
                        <ColumnDefinition Width="2*"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition></RowDefinition>
                        <RowDefinition></RowDefinition>
                    </Grid.RowDefinitions>

                    <TextBlock Grid.Column="0"
                               VerticalAlignment="Center"
                               HorizontalAlignment="Right"
                               Text="货架编码："
                               FontSize="18"></TextBlock>
                    <TextBox Grid.Column="1"
                             VerticalAlignment="Center"
                             HorizontalAlignment="Stretch"
                             FontSize="18"
                             MinWidth="90"
                             Text="{Binding ShelfCode}"></TextBox>

                    <TextBlock  Grid.Column="0"
                                Grid.Row="1"
                                VerticalAlignment="Center"
                                HorizontalAlignment="Right"
                                Text="创建人："
                                FontSize="18"></TextBlock>
                    <TextBox Grid.Column="1"
                             Grid.Row="1"
                             VerticalAlignment="Center"
                             HorizontalAlignment="Stretch"
                             FontSize="18"
                             MinWidth="90"
                             Text="{Binding CreateUser}"
                             ></TextBox>

                    <TextBlock Grid.Column="2"
                               VerticalAlignment="Center"
                               HorizontalAlignment="Right"
                               Text="任务状态："
                               FontSize="18"></TextBlock>
                    <ComboBox Grid.Column="3"
                              VerticalAlignment="Center"
                              HorizontalAlignment="Stretch"
                              FontSize="18"
                              MinWidth="90"
                              ItemsSource="{Binding TaskStatus}"
                              SelectedValue="{Binding SelectedTaskStatus}">
                    </ComboBox>

                    <TextBlock Grid.Column="4"
                               VerticalAlignment="Center"
                               HorizontalAlignment="Right"
                               Text="起点："
                               FontSize="18"></TextBlock>
                    <TextBox Grid.Column="5"
                             VerticalAlignment="Center"
                             HorizontalAlignment="Stretch"
                             FontSize="18"
                             MinWidth="90"
                             Text="{Binding StartLocationCode}"></TextBox>

                    <TextBlock Grid.Column="6"
                                VerticalAlignment="Center"
                                HorizontalAlignment="Right"
                                Text="终点："
                                FontSize="18">
                    </TextBlock>
                    <TextBox Grid.Column="7"
                             VerticalAlignment="Center"
                             HorizontalAlignment="Stretch"
                             FontSize="18"
                             MinWidth="90"
                             Text="{Binding EndLocationCode}"></TextBox>

                    <Button Style="{StaticResource ButtonSuccess}"
                            hc:BorderElement.CornerRadius="15"
                            Grid.Column="9"
                            MinHeight="40"
                            FontSize="18"
                            Content="&#xe8b9; 搜索"
                            FontFamily="{StaticResource IconFont}"
                            Command="{Binding BtnSearchCommand}"></Button>
                    <Button Style="{StaticResource ButtonWarning}"
                            hc:BorderElement.CornerRadius="15"
                            Grid.Column="10"
                            MinHeight="40"
                            FontSize="18"
                            Content="&#xe652; 重置"
                            FontFamily="{StaticResource IconFont}"
                            Command="{Binding BtnResetCommand}"></Button>
                </Grid>
            </Border>
            <Border Grid.Row="1"
                    Margin="5"
                    Background="AliceBlue"
                    CornerRadius="5"
                    Padding="0">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="0.8*"></RowDefinition>
                        <RowDefinition Height="9*"></RowDefinition>
                        <RowDefinition Height="0.8*"></RowDefinition>
                    </Grid.RowDefinitions>
                    <StackPanel Grid.Row="0"
                                Orientation="Horizontal">
                        <Button MinHeight="40"
                                FontSize="18"
                                Margin="5"
                                Content="&#xe652;重新下发"
                                FontFamily="{StaticResource IconFont}"
                                Foreground="WhiteSmoke"
                                Background="Green"
                                Command="{Binding BtnResendCommand}"></Button>

                        <Button MinHeight="40"
                                FontSize="18"
                                Margin="5"
                                Content="&#xe64c;取  消"
                                FontFamily="{StaticResource IconFont}"
                                Foreground="WhiteSmoke"
                                Command="{Binding BtnCancelCommand}"
                                Style="{StaticResource ButtonDanger}"></Button>
                    </StackPanel>
                    <DataGrid Grid.Row="1"
                              SelectionChanged="DataGrid_SelectionChanged"
                              SelectedItem="{Binding SelectedataGridItem}"
                              Name="dataGrid"
                              SelectedCellsChanged="DataGrid_SelectedCellsChanged"
                              ItemsSource="{Binding DataGridItemSource}"
                              RowHeight="39"
                              AutoGenerateColumns="False"
                              FontSize="13">
                        <DataGrid.Columns>
                            <DataGridTemplateColumn CanUserResize="False">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <CheckBox Width="30"
                                                  Height="30"
                                                  IsHitTestVisible="False"
                                                  IsChecked="{Binding IsSelected}" />
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>
                                <DataGridTemplateColumn.HeaderTemplate>
                                    <DataTemplate>
                                        <CheckBox Width="30"
                                                  Height="30"
                                                  Unchecked="allChecked_Unchecked"
                                                  Checked="allChecked_Checked"
                                                  Name="allChecked" />
                                    </DataTemplate>
                                </DataGridTemplateColumn.HeaderTemplate>
                            </DataGridTemplateColumn>
                            <DataGridTextColumn IsReadOnly="True"
                                                Header="序号"
                                                Binding="{Binding RowNumber}"></DataGridTextColumn>
                            <DataGridTextColumn  Header="任务单号"
                                                 Binding="{Binding TaskCode}"></DataGridTextColumn>

                            <DataGridTextColumn  Header="任务状态"
                     Binding="{Binding TaskStatus}"></DataGridTextColumn>
                            <DataGridTextColumn  Header="AGV编号"
Binding="{Binding AgvCode}"></DataGridTextColumn>
                            <DataGridTextColumn  Header="AGV状态"
Binding="{Binding AgvStatus}"></DataGridTextColumn>
                            <DataGridTextColumn IsReadOnly="True"
                    Header="最后更新时间"
                    Binding="{Binding ModifyTime ,StringFormat='yyyy-MM-dd HH:mm:ss'}"></DataGridTextColumn>

                            <DataGridTextColumn  Header="货架编码"
                                                 Binding="{Binding ShelfCode}"></DataGridTextColumn>
                            <DataGridTextColumn  Header="起点"
                                                 Binding="{Binding StartLocationCode}"></DataGridTextColumn>
                            <DataGridTextColumn  Header="终点"
                                                 Binding="{Binding EndLocationCode}"></DataGridTextColumn>
                            <DataGridTextColumn IsReadOnly="True"
                                                Header="创建人"
                                                Binding="{Binding CreateUser}"></DataGridTextColumn>
                            <DataGridTextColumn IsReadOnly="True"
                                                Header="创建时间"
                                                Binding="{Binding CreateTime ,StringFormat='yyyy-MM-dd HH:mm:ss'}"></DataGridTextColumn>
                        </DataGrid.Columns>
                    </DataGrid>
                    <Grid Grid.Row="2">
                        <Border CornerRadius="3"
                                Background="Transparent"
                                VerticalAlignment="Center">
                            <Grid HorizontalAlignment="Stretch"
                                  Margin="0"
                                  VerticalAlignment="Top"
                                  Width="Auto"
                                  MinHeight="26">
                                <Grid.RowDefinitions>
                                    <RowDefinition />
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="5*"></ColumnDefinition>
                                    <ColumnDefinition Width="5*"></ColumnDefinition>
                                    <ColumnDefinition Width="5*"></ColumnDefinition>
                                </Grid.ColumnDefinitions>
                                <StackPanel Orientation="Horizontal"
                                            VerticalAlignment="Center"
                                            Margin="5">
                                    <TextBlock FontSize="14"
                                               VerticalAlignment="Center"
                                               Text="共"></TextBlock>
                                    <TextBlock FontSize="14"
                                               VerticalAlignment="Center"
                                               Text="{Binding TotalCount ,FallbackValue=0}"></TextBlock>
                                    <TextBlock FontSize="14"
                                               VerticalAlignment="Center"
                                               Text="条记录  "></TextBlock>
                                    <TextBlock FontSize="14"
                                               VerticalAlignment="Center"
                                               Text="第"></TextBlock>
                                    <TextBlock FontSize="14"
                                               VerticalAlignment="Center"
                                               Text="{Binding CurrentPage,FallbackValue=0}"></TextBlock>
                                    <TextBlock FontSize="14"
                                               VerticalAlignment="Center"
                                               Text="/"></TextBlock>
                                    <TextBlock FontSize="14"
                                               VerticalAlignment="Center"
                                               Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
                                    <TextBlock FontSize="14"
                                               VerticalAlignment="Center"
                                               Text="页 "></TextBlock>
                                    <ComboBox FontSize="14"
                                              VerticalAlignment="Center"
                                              SelectedValue="{Binding PageSize}"
                                              SelectedValuePath="Tag">
                                        <ComboBoxItem Tag="10"
                                                      IsSelected="True">10条/页</ComboBoxItem>
                                        <ComboBoxItem Tag="20">20条/页</ComboBoxItem>
                                        <ComboBoxItem Tag="50">50条/页</ComboBoxItem>
                                        <ComboBoxItem Tag="100">100条/页</ComboBoxItem>
                                        <ComboBoxItem Tag="500">500条/页</ComboBoxItem>
                                    </ComboBox>
                                </StackPanel>
                                <StackPanel Orientation="Horizontal"
                                            HorizontalAlignment="Center"
                                            Grid.Column="1">
                                    <Grid>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="30"></RowDefinition>
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="auto" />
                                            <ColumnDefinition Width="auto" />
                                            <ColumnDefinition Width="auto" />
                                            <ColumnDefinition Width="auto" />
                                            <ColumnDefinition Width="auto" />
                                        </Grid.ColumnDefinitions>
                                        <Button BorderBrush="Transparent"
                                                Background="Transparent"
                                                Grid.Column="0"
                                                Name="btnFirst"
                                                Content="首页"
                                                Foreground="Black"
                                                FontSize="14"
                                                Command="{Binding BtnFirstPageCommand}" />
                                        <Button BorderBrush="Transparent"
                                                Background="Transparent"
                                                Grid.Column="1"
                                                Name="btnPrev"
                                                Content="上一页"
                                                FontSize="14"
                                                Command="{Binding BtnPrePageCommand}" />
                                        <TextBox BorderBrush="Transparent"
                                                 Grid.Column="2"
                                                 FontSize="14"
                                                 MinWidth="50"
                                                 HorizontalAlignment="Center"
                                                 VerticalAlignment="Center"
                                                 Cursor="IBeam"
                                                 IsEnabled="False"
                                                 Text="{Binding CurrentPage}"
                                                 TextAlignment="Center" />
                                        <Button BorderBrush="Transparent"
                                                Background="Transparent"
                                                Grid.Column="3"
                                                Name="btnNext"
                                                Content="下一页"
                                                FontSize="14"
                                                Command="{Binding BtnNextPageCommand}" />
                                        <Button BorderBrush="Transparent"
                                                Background="Transparent"
                                                Grid.Column="4"
                                                Name="btnLast"
                                                Content="末页"
                                                FontSize="14"
                                                Command="{Binding BtnLastPageCommand}" />
                                    </Grid>
                                </StackPanel>
                            </Grid>
                        </Border>
                    </Grid>
                </Grid>
            </Border>
        </Grid>
    </Border>
</pi:UserControlBase>
