<pi:UserControlBase  
        xmlns:pi="https://github.com/ping9719/wpfex"
        x:Class="智慧物流软件系统.BatchBindMatDetailView"
        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" Loaded="LoadedVisible">
    <Border Margin="0" Background="AliceBlue" CornerRadius="3" Padding="0">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="1*"></RowDefinition>
                <RowDefinition Height="9*"></RowDefinition>
            </Grid.RowDefinitions>
            <Border Grid.Row="0" Margin="5 5 5 0" Background="AliceBlue" CornerRadius="5" Padding="0">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="1.9*"></ColumnDefinition>
                        <ColumnDefinition Width="2*"></ColumnDefinition>
                        <ColumnDefinition Width="1.9*"></ColumnDefinition>
                        <ColumnDefinition Width="2*"></ColumnDefinition>
                        <ColumnDefinition Width="1.9*"></ColumnDefinition>
                        <ColumnDefinition Width="2*"></ColumnDefinition>
                        <ColumnDefinition Width="1.9*"></ColumnDefinition>
                        <ColumnDefinition Width="2*"></ColumnDefinition>
                        <ColumnDefinition Width="2*"></ColumnDefinition>
                        <ColumnDefinition Width="2*"></ColumnDefinition>
                        <ColumnDefinition Width="2*"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0"
                               VerticalAlignment="Center"
                               HorizontalAlignment="Right"
                               Text="单据类型："
                               FontSize="18"></TextBlock>
                    <ComboBox Grid.Row="0"
                              Grid.Column="1"
                              DisplayMemberPath="OrderTypeName"
                              ItemsSource="{Binding OrderTypeItems}"
                              SelectedItem="{Binding SelectedOrderTypeItem}"
                              Height="30"
                              FontSize="18"
                              IsEditable="False" />
                    
                    <TextBlock Grid.Column="2" 
                               VerticalAlignment="Center" HorizontalAlignment="Right" 
                               Text="单据编号：" FontSize="18" ></TextBlock>
                    <TextBox Grid.Column="3" 
                               VerticalAlignment="Center" HorizontalAlignment="Stretch" 
                               FontSize="18" MinWidth="90" Text="{Binding OrderNumber}"></TextBox>
                    <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 ShelfCode}"></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="8.2*"></RowDefinition>
                        <RowDefinition Height="0.8*"></RowDefinition>
                    </Grid.RowDefinitions>

                    <StackPanel Grid.Row="0" Orientation="Horizontal">
                        
                        <!--<Button MinHeight="40"
                                FontSize="18"
                                Margin="5"
                                Content="&#xe604;新  增"
                                FontFamily="{StaticResource IconFont}"
                                Foreground="WhiteSmoke"
                                Background="HotPink"
                                Command="{Binding BtnAddCommand}"></Button>-->
                        
                        <Button MinHeight="40" FontSize="18" Margin="5"
                                Content="&#xe612;修  改" FontFamily="{StaticResource IconFont}"
                                Foreground="WhiteSmoke"
                                Background="CadetBlue"
                                Command="{Binding BtnEditCommand}">
                        </Button>
                        <Button MinHeight="40"
                                FontSize="18"
                                Margin="5"
                                Content="&#xe8c1;删  除"
                                FontFamily="{StaticResource IconFont}"
                                Foreground="WhiteSmoke"
                                Command="{Binding BtnDeleteCommand}"
                                Style="{StaticResource ButtonDanger}"></Button>
                        
                        <TextBlock VerticalAlignment="Bottom"
                                   Margin="25 5 5 5"
                                   Foreground="Blue"
                                   TextDecorations="Underline"
                                   Text="下载导入模板">
                            <TextBlock.InputBindings>
                                <MouseBinding Gesture="LeftClick" Command="{Binding DownloadImportTemplateCommand}" />
                            </TextBlock.InputBindings>
                        </TextBlock>
                        
                        <Button MinHeight="40"
                                FontSize="18"
                                Margin="5"
                                Content="&#xe613;导  入"
                                FontFamily="{StaticResource IconFont}"
                                Command="{Binding BtnImportCommand}"
                                Foreground="WhiteSmoke"
                                Background="Green"></Button>
                        <Button MinHeight="40" FontSize="18" Margin="5"
                                Content="&#xe866;导  出" FontFamily="{StaticResource IconFont}"
                                Command="{Binding BtnExportCommand}"
                                Foreground="WhiteSmoke"
                                Background="DarkOrange">
                        </Button>
                        
                        <TextBlock MinHeight="40"
                                   FontSize="25"
                                   Margin="20 0 0 0 "
                                   VerticalAlignment="Center">绑定人:</TextBlock>
                        <TextBlock MinHeight="40"
                                   FontSize="25"
                                   VerticalAlignment="Center"
                                   Text="{Binding StationCode}"></TextBlock>
                        <!--<Button MinHeight="40"
                                FontSize="18"
                                Margin="5"
                                Content="呼叫货架&#xe6a9;"
                                FontFamily="{StaticResource IconFont}"
                                Command="{Binding BtnCallIn}"
                                Foreground="WhiteSmoke"
                                Background="CadetBlue"></Button>
                        <Button MinHeight="40"
                                FontSize="18"
                                Margin="5"
                                Content="送货架&#xe622;"
                                FontFamily="{StaticResource IconFont}"
                                Command="{Binding BtnSend}"
                                Foreground="WhiteSmoke"
                                Background="OrangeRed"></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="单据类型" MaxWidth="150" Binding="{Binding OrderTypeName}"></DataGridTextColumn>
                            <DataGridTextColumn  Header="单据编号"
                                                 MaxWidth="150"
                                                 Binding="{Binding OrderNumber}"></DataGridTextColumn>
  
     
                            <DataGridTextColumn  Header="物料编码" Binding="{Binding MatCode}"></DataGridTextColumn>
                            <DataGridTextColumn  Header="物料名称" Binding="{Binding MatName}"></DataGridTextColumn>
                            <DataGridTextColumn  Header="物料批次" Binding="{Binding MatBatch}"></DataGridTextColumn>
                            <DataGridTextColumn  Header="物料规格"
                                                 Binding="{Binding MatSpec}"
                                                 MaxWidth="150"></DataGridTextColumn>
                            <DataGridTextColumn  Header="数量" Binding="{Binding MatQty}"></DataGridTextColumn>
                            <DataGridTextColumn  Header="货架编码"
                                                 Binding="{Binding ShelfCode}"></DataGridTextColumn>
                            
                            <DataGridTextColumn IsReadOnly="True" Header="绑定人" Binding="{Binding StationCode}"></DataGridTextColumn>
                            <DataGridTextColumn IsReadOnly="True" Header="更新时间" Binding="{Binding ModifyTime ,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>
            <!--<Border Grid.Row="1" Margin="3" Background="AliceBlue" CornerRadius="3" Padding="0">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="0.8*"></RowDefinition>
                        <RowDefinition Height="8*"></RowDefinition>
                        <RowDefinition Height="0.7*"></RowDefinition>
                    </Grid.RowDefinitions>
                    <StackPanel Grid.Row="0" Orientation="Horizontal">
                        <Button MinHeight="40" FontSize="18" Margin="5" Command="{Binding BtnExportCommand}"
                                Content="&#xe866; 导  出" FontFamily="{StaticResource IconFont}"
                                Style="{StaticResource ButtonWarning}" Background="DarkOrange">
                        </Button>
                    </StackPanel>
                    <DataGrid Grid.Row="1" 
                              SelectedCellsChanged="DataGrid_SelectedCellsChanged"
                              ItemsSource="{Binding DataGridItemSource}" 
                              RowHeight="39" 
                              AutoGenerateColumns="False"
                              FontSize="13">
                        <DataGrid.Columns>
                            <DataGridTextColumn  Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
                            <DataGridTextColumn  Header="接口地址" Binding="{Binding RequestUrl}"></DataGridTextColumn>
                            <DataGridTextColumn  Header="设备IP" Binding="{Binding DeviceIp}"></DataGridTextColumn>
                            <DataGridTextColumn  Header="请求参数" Binding="{Binding RequestBody}" MaxWidth="100"></DataGridTextColumn>
                            <DataGridTextColumn  Header="QueryString" Binding="{Binding QueryString}" MaxWidth="100"></DataGridTextColumn>
                            <DataGridTextColumn  Header="请求时间" Binding="{Binding RequestTime,StringFormat='yyyy-MM-dd HH:mm:ss'}"></DataGridTextColumn>
                            <DataGridTextColumn  Header="返回参数" Binding="{Binding ResponseJson}" MaxWidth="100"></DataGridTextColumn>
                            <DataGridTextColumn  Header="返回时间" Binding="{Binding ResponseTime,StringFormat='yyyy-MM-dd HH:mm:ss'}"></DataGridTextColumn>
                            <DataGridTextColumn  Header="耗时(ms)" Binding="{Binding ExecutionTime}"></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" Margin="5">
                                    <TextBlock FontSize="14" Text="共"></TextBlock>
                                    <TextBlock FontSize="14" Text="{Binding TotalCount ,FallbackValue=0}"></TextBlock>
                                    <TextBlock FontSize="14" Text="条记录  "></TextBlock>
                                    <TextBlock FontSize="14" Text="第"></TextBlock>
                                    <TextBlock FontSize="14" Text="{Binding CurrentPage,FallbackValue=0}"></TextBlock>
                                    <TextBlock FontSize="14" Text="/"></TextBlock>
                                    <TextBlock FontSize="14" Text="{Binding MaxPage,FallbackValue=0}"></TextBlock>
                                    <TextBlock FontSize="14" Text="页"></TextBlock>
                                </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>
