<hc:Window x:Class="智慧物流软件系统.StocktakingDocumentDetailView"
        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="500" Width="800" WindowStyle="None" BorderThickness="0" Background="{x:Null}" 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 BorderBrush="Gray" Background="WhiteSmoke" CornerRadius="5" BorderThickness="1">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"></RowDefinition>
                <RowDefinition Height="*"></RowDefinition>
                <RowDefinition Height="auto"></RowDefinition>
            </Grid.RowDefinitions>
            <TextBlock FontSize="24" 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"/>

            <Grid Margin="5,0" Grid.Row="1" >
                <DataGrid Grid.Row="1" SelectedCellsChanged="DataGrid_SelectedCellsChanged"
                              ItemsSource="{Binding DataGridItemSource}" 
                              RowHeight="39" 
                              AutoGenerateColumns="False" Name="dg1"  FontSize="13">
                    <DataGrid.Columns>
                        <DataGridTextColumn IsReadOnly="True"  Header="序号" Binding="{Binding RowNumber}"></DataGridTextColumn>
                        <DataGridTextColumn IsReadOnly="True" Header="已盘点" Binding="{Binding IsStocktaking,Converter={StaticResource Boolean2StringConverter},ConverterParameter=否;是}"></DataGridTextColumn>
                        <DataGridTextColumn IsReadOnly="True" Header="盘点单据编码" Binding="{Binding StocktakingOrderNumber}"></DataGridTextColumn>
                        <DataGridTextColumn IsReadOnly="True" Header="库位" Binding="{Binding StoreCode}"></DataGridTextColumn>
                        <DataGridTextColumn IsReadOnly="True" Header="物料编码" Binding="{Binding MatCode}"></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 MatQty}"></DataGridTextColumn>
                        <DataGridTextColumn IsReadOnly="True" Header="盘点数量" Binding="{Binding StocktakingQty}"></DataGridTextColumn>
                        <DataGridTextColumn IsReadOnly="True" Header="物料SN" Binding="{Binding MatSN}"></DataGridTextColumn>
                    </DataGrid.Columns>
                </DataGrid>
            </Grid>

            <StackPanel Margin="5" x:Name="spacingPanel" Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
                <Button Margin="5" Content="确认" FontSize="18" Click="closeClick"/>
            </StackPanel>
        </Grid>
    </Border>
</hc:Window>
