<hc:Window x:Class="智能仓储WCS管理系统.MXOutOrderDetailView"
        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"
        mc:Ignorable="d"
        xmlns:hc="https://handyorg.github.io/handycontrol"
        Height="480" Width="800" WindowStyle="None"  Background="{x:Null}" BorderThickness="0" AllowsTransparency="True" WindowStartupLocation="CenterScreen" Opacity="1">
    <hc:Window.Resources>
        <ResourceDictionary>
            <Style TargetType="Button" BasedOn="{StaticResource ButtonDefault}">
                <Setter Property="Padding" Value="25,0"></Setter>
            </Style>
        </ResourceDictionary>
    </hc:Window.Resources>

    <Border Background="AliceBlue" CornerRadius="10" BorderThickness="1.5" BorderBrush="RosyBrown" >
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="1.5*"></RowDefinition>
                <RowDefinition Height="1.5*"></RowDefinition>
                <RowDefinition Height="10*"></RowDefinition>
                <RowDefinition Height="0.8*"></RowDefinition>
                <RowDefinition Height="1.5*"></RowDefinition>
            </Grid.RowDefinitions>
            <TextBlock FontSize="25" Name="Title" Text="发 料 明 细" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Center"/>
            <Button Margin="-5,-1" Visibility="{Binding IsClose,Converter={StaticResource Boolean2VisibilityConverter}}" Style="{StaticResource ButtonIcon}" hc:IconElement.Geometry="{StaticResource CloseGeometry}" HorizontalAlignment="Right" VerticalAlignment="Top" Click="closeClick"/>

            <StackPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Center">
                <TextBlock FontSize="23" Text="当前发料单号:"></TextBlock>
                <TextBlock FontSize="23" Text="{Binding BillNumber}"></TextBlock>
            </StackPanel>
            
            
            <Grid Margin="5,0" Grid.Row="2" >
                <DataGrid Grid.Row="1" SelectedCellsChanged="DataGrid_SelectedCellsChanged"
                              RowHeight="39" ItemsSource="{Binding DataGridItemSource}"
                              AutoGenerateColumns="False" Name="dg1"  FontSize="13">
                    <DataGrid.Columns>
                        <DataGridTemplateColumn CanUserResize="False">
                            <DataGridTemplateColumn.CellTemplate>
                                <DataTemplate>
                                    <CheckBox Width="30" Height="30"  
                                         Checked="CheckBox_Checked"
                                         Unchecked="CheckBox_Checked"
                                         IsChecked="{Binding IsSelected , UpdateSourceTrigger=PropertyChanged}"/>
                                </DataTemplate>
                            </DataGridTemplateColumn.CellTemplate>
                            <DataGridTemplateColumn.HeaderTemplate>
                                <DataTemplate>
                                    <CheckBox Width="30" Height="30" IsChecked="True"  Unchecked="allChecked_Unchecked" Checked="allChecked_Checked"  Name="allChecked"/>
                                </DataTemplate>
                            </DataGridTemplateColumn.HeaderTemplate>
                        </DataGridTemplateColumn>
                        <DataGridTextColumn IsReadOnly="True" Header="物料编码" Binding="{Binding MatCode}"></DataGridTextColumn>
                        <DataGridTextColumn IsReadOnly="True" Header="数量" Binding="{Binding MatQty}"></DataGridTextColumn>
                        <DataGridTextColumn IsReadOnly="True" Header="物料名称" Binding="{Binding MatName}"></DataGridTextColumn>
                        <DataGridTextColumn IsReadOnly="True" Header="规格" Binding="{Binding MatSpec}"></DataGridTextColumn>
                        <DataGridTextColumn IsReadOnly="True" Header="批次" Binding="{Binding MatBatch}"></DataGridTextColumn>
                        <DataGridTextColumn IsReadOnly="True" Header="最小包装条码" Binding="{Binding MatSN}"></DataGridTextColumn>
                        <DataGridTextColumn IsReadOnly="True" Header="库位" Binding="{Binding StoreCode}"></DataGridTextColumn>
                        <DataGridTextColumn IsReadOnly="True" Header="入库时间" Binding="{Binding InstoreTime}"></DataGridTextColumn>
                    </DataGrid.Columns>
                </DataGrid>
            </Grid>
            <StackPanel Grid.Row="3" HorizontalAlignment="Right" Orientation="Horizontal"  >
                <TextBlock FontSize="20" Text="料盘数："></TextBlock>
                <TextBlock FontSize="20"  Name="selectedPan" Text="{Binding SelectedPan}"></TextBlock>

                <TextBlock FontSize="20" Text="  已勾选数量："></TextBlock>
                <TextBlock FontSize="20"  Name="selectedCount" Text="{Binding SelectedCount}"></TextBlock>
            </StackPanel>
            <StackPanel Margin="3" x:Name="spacingPanel" Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
                <Button Margin="0" Content="确 认" Background="RosyBrown" Foreground="White" MinHeight="40" FontSize="21" Click="comfirmClick"/>
                <TextBlock Margin="20" Text=""></TextBlock>
                <Button Margin="0" Content="取 消"  Background="CadetBlue" Foreground="White"  MinHeight="40" FontSize="21" Click="closeClick"/>
            </StackPanel>
        </Grid>
    </Border>
</hc:Window>
