<Window x:Class="Khd.Core.Wpf.WindowPage.StockWindow"
        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:local="clr-namespace:Khd.Core.Wpf.WindowPage"
        mc:Ignorable="d"
         Title="查看库存" Height="600" Width="1500" WindowStartupLocation="CenterScreen"  Background="#172557">

    <Window.Resources>

        <ResourceDictionary>

            <Style x:Key="dgCell" TargetType="TextBlock" BasedOn="{x:Null}">
                <Setter Property="TextAlignment" Value="Center" />
                <Setter Property="HorizontalAlignment" Value="Center" />
                <Setter Property="VerticalAlignment" Value="Center" />
            </Style>

            <ResourceDictionary.MergedDictionaries>
                <!--<hc:ThemeResources/>
                 <hc:Theme/>-->
                <ResourceDictionary Source="/CSS/SearchBtnClass.xaml" />
                <ResourceDictionary Source="/CSS/SearchTextClass.xaml" />
                <ResourceDictionary Source="/CSS/DataGridClass.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="8*"/>
        </Grid.RowDefinitions>

        <Grid Grid.Row="0">
            <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Orientation="Horizontal">
                <TextBox x:Name="positionRowTxt"  FontSize="25" Margin="0 0 10 0" Width="100"/>
                <TextBlock Text="行" Foreground="White" FontSize="25" Margin="0 0 25 0"/>
                <TextBox x:Name="positionColumnTxt"  FontSize="25" Margin="0 0 10 0" Width="100"/>
                <TextBlock Text="列" Foreground="White" FontSize="25" Margin="0 0 25 0"/>
                <TextBox x:Name="positionLayerTxt"  FontSize="25" Margin="0 0 10 0" Width="80"/>
                <TextBlock Text="层" Foreground="White" FontSize="25" Margin="0 0 150 0"/>
               
                <TextBlock Text="库位编号:" Foreground="White" FontSize="25" Margin="0 0 8 0"/>
                <TextBlock x:Name="locationTxt" Foreground="White" FontSize="25" Margin="0 0 58 0" Width="250"/>
                <TextBlock Text="托盘编号:" Foreground="White" FontSize="25" Margin="0 0 8 0"/>
                <TextBlock x:Name="palletTxt" Foreground="White" FontSize="25"/>
            </StackPanel>
        </Grid>
        <Grid Grid.Row="1">
            <DataGrid 
                                              Style="{StaticResource DataGridStyle}"
                                              Grid.Row="2" AlternationCount="2"
                                              AutoGenerateColumns="False"
                                              MinRowHeight="50"
                                              Background="#172557"
                                              CanUserAddRows="False"
                                              GridLinesVisibility="None"
                                              CanUserReorderColumns="False"
                                              CanUserResizeColumns="False"
                                              CanUserResizeRows="False"
                                              Focusable="False"
                                              Height="auto"
                                              HeadersVisibility="Column"
                                              IsReadOnly="True"
                                              RowHeaderWidth="0"
                                              SelectionMode="Single" FontSize="16"
                                              Visibility="Visible"
                                             VerticalAlignment="Top"
                                              x:Name="StockDataGrid">
                <DataGrid.Columns>


                 
                    <DataGridTextColumn
                                                     Width="200*"
                                                     Binding="{Binding materialCode}"
                                                     CanUserSort="False"
                                                     ElementStyle="{StaticResource dgCell}"
                                                     FontSize="20"
                                                     Header="物料编码"
                                                     IsReadOnly="True" />
                    <DataGridTemplateColumn
                                                        Width="280*"
                                                        CanUserSort="False"
                                                        Header="物料名称"
                                                        IsReadOnly="True" >
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock TextWrapping="Wrap" Text="{Binding materialName}" ToolTip="{Binding materialNameSrc}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="20" />
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTemplateColumn
                                                   Width="300*"
                                                   CanUserSort="False"
                                                   Header="物料规格"
                                                   IsReadOnly="True" >
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock TextWrapping="Wrap" Text="{Binding materialSpec}" ToolTip="{Binding materialSpecSrc}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="20" />
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>

                    <DataGridTemplateColumn
                                                   Width="130*"
                                                   CanUserSort="False"
                                                   Header="总数"
                                                   IsReadOnly="True" >
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock TextWrapping="Wrap" Text="{Binding totalAmount}" ToolTip="{Binding totalAmount}" Height="auto" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="20" />
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                    <DataGridTemplateColumn
                                                   Width="130*"
                                                   CanUserSort="False"
                                                   Header="冻结数量"
                                                   IsReadOnly="True" >
                        <DataGridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock TextWrapping="WrapWithOverflow" Text="{Binding frozenAmount}" Height="auto" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="20" />
                            </DataTemplate>
                        </DataGridTemplateColumn.CellTemplate>
                    </DataGridTemplateColumn>
                </DataGrid.Columns>
                <DataGrid.CellStyle>
                    <Style TargetType="{x:Type DataGridCell}">
                        <Setter Property="Background" Value="#213269" />
                        <Setter Property="Foreground" Value="White" />
                        <Setter Property="HorizontalContentAlignment" Value="Center" />
                    </Style>

                </DataGrid.CellStyle>
                <DataGrid.RowStyle>
                    <Style TargetType="{x:Type DataGridRow}">
                        <Setter Property="Background" Value="#213269" />
                        <Setter Property="Foreground" Value="White" />
                    </Style>
                </DataGrid.RowStyle>
                <DataGrid.RowHeaderStyle>
                    <Style TargetType="{x:Type DataGridRowHeader}">
                        <Setter Property="Background" Value="#213269" />
                        <Setter Property="Foreground" Value="White" />
                        <Setter Property="HorizontalContentAlignment" Value="Center" />
                    </Style>
                </DataGrid.RowHeaderStyle>
                <DataGrid.ColumnHeaderStyle>
                    <Style TargetType="{x:Type DataGridColumnHeader}">
                        <Setter Property="Background" Value="#172560" />
                        <Setter Property="Foreground" Value="White" />
                        <Setter Property="HorizontalContentAlignment" Value="Center" />
                        <Setter Property="Margin" Value="0,0,0,0" />
                        <Setter Property="BorderThickness" Value="5" />
                        <Setter Property="BorderBrush" Value="#172540" />
                        <Setter Property="FontSize" Value="30" />
                    </Style>
                </DataGrid.ColumnHeaderStyle>
            </DataGrid>
        </Grid>
    </Grid>

   
</Window>
