<Window x:Class="Aucma.Core.PalletizCX1.Views.HandPalletizView"
        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"  WindowStartupLocation="CenterScreen"  FontFamily="Microsoft YaHei"
        Title="手动分垛"  Height="800" Width="1600" Name="window" Background="White"
        ResizeMode="NoResize">

    <Window.Resources>
        <Style TargetType="{x:Type Slider}">
            <Style.Resources>
                <!-- 重写重复触发按钮的样式 -->
                <Style x:Key="RepeatButtonStyle" TargetType="{x:Type RepeatButton}">
                    <Setter Property="Focusable" Value="false" />
                    <Setter Property="IsTabStop" Value="false" />
                    <Setter Property="Padding" Value="0" />
                    <Setter Property="Width" Value="30" />
                </Style>
            </Style.Resources>
            <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false" />
            <Setter Property="SmallChange" Value="1" />
        </Style>
        <Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
            <!--<Setter Property="Height" Value="40"/>-->
            <Setter Property="FontSize" Value="16"/>
            <Setter Property="VerticalAlignment" Value="Stretch" />
            <Setter Property="HorizontalAlignment"  Value="Left" />
        </Style>
        <Style TargetType="DataGrid">
            <!--网格线颜色-->
            <Setter Property="CanUserResizeColumns" Value="false"/>
            <Setter Property="Background" Value="#1152AC" />
            <Setter Property="BorderBrush" Value="#4285DE" />
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="HorizontalGridLinesBrush">
                <Setter.Value>
                    <SolidColorBrush Color="#4285DE"/>
                </Setter.Value>
            </Setter>
            <Setter Property="VerticalGridLinesBrush">
                <Setter.Value>
                    <SolidColorBrush Color="#1152AC"/>
                </Setter.Value>
            </Setter>
        </Style>
        <!--列头标题栏样式-->
        <Style TargetType="DataGridColumnHeader">
            <!--<Setter Property="HorizontalContentAlignment" Value="Center"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>-->
            <!--<Setter Property="Background" Value="#dddddd"/>
            <Setter Property="Foreground" Value="Black"/>-->
            <!--<Setter Property="BorderThickness" Value="1" />-->
            <Setter Property="HorizontalContentAlignment" Value="Left" />
            <Setter Property="BorderBrush" Value="#dddddd" />
            <Setter Property="Height" Value="48"/>
            <Setter Property="FontSize" Value="18"/>
            <Setter Property="Background" Value="#4285DE"/>
            <Setter Property="Foreground" Value="White"/>
        </Style>

        <!--单元格样式-->
        <Style TargetType="DataGridCell">
            <Setter Property="FocusVisualStyle" Value="{x:Null}" />
            <Setter Property="BorderThickness" Value="0" />
            <Setter Property="BorderBrush" Value="Gray" />
            <Setter Property="Height" Value="40"/>
            <Setter Property="FontSize" Value="12"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type DataGridCell}">
                        <Grid Background="{TemplateBinding Background}" >
                            <ContentPresenter HorizontalAlignment="Left" VerticalAlignment="Center" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="IsSelected" Value="True">
                    <Setter Property="Background" Value="#4285DE"/>
                    <Setter Property="Foreground" Value="White"/>
                </Trigger>
            </Style.Triggers>

        </Style>
    </Window.Resources>
    <Border Margin="5" Background="#1254AB" CornerRadius="10">
        <Border.Effect>
            <DropShadowEffect Color="Gray" ShadowDepth="0" BlurRadius="5" Opacity="0.3" Direction="0"></DropShadowEffect>
        </Border.Effect>

        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <Border Grid.Column="0" BorderBrush="#1254AB" BorderThickness="1" CornerRadius="5" Background="Transparent" Margin="5,5">
                <Border.Effect>
                    <DropShadowEffect Color="#1254AB" Direction="270" BlurRadius="10" ShadowDepth="5" Opacity="0.5"/>
                </Border.Effect>

                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="0.5*"/>
                        <RowDefinition Height="6*"/>

                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <StackPanel Grid.Row="0" Orientation="Horizontal"  VerticalAlignment="Center" HorizontalAlignment="Center" >
                        <TextBlock Text="手动分垛" FontSize="25" Foreground="#FFFFFF" Margin="10,0,0,0"/>
                    </StackPanel>
                    <Border Grid.Row="1"  BorderThickness="4" >
                        <DataGrid  ItemsSource="{Binding MaterialDataGrid}" Height="{Binding Path=ActualHeight, ElementName=HeightPanel}"
                           HorizontalAlignment="Left" VerticalAlignment="Top"  AlternationCount="2"      RowHeaderWidth="0"
                     ColumnWidth="*" AutoGenerateColumns="False" IsReadOnly="True" CanUserAddRows="False" SelectionMode="Single" 
                       SelectedItem="{Binding SelectedDataItem}" SelectionChanged="DataGrid_SelectionChanged" >
                            <DataGrid.Columns>
                                <!--<DataGridTextColumn Binding="{Binding OrderCode}" Width="*" Header="订单编码"  ElementStyle="{StaticResource  DataGridTextColumnCenterSytle}"/>-->
                                <DataGridTextColumn  Binding="{Binding ProductCode}" Width="3*" Header="产品编码"  ElementStyle="{StaticResource  DataGridTextColumnCenterSytle}"/>
                                <DataGridTextColumn Binding="{Binding ProductName}" Width="5*"  Header="产品名称"  ElementStyle="{StaticResource  DataGridTextColumnCenterSytle}"/>
                                <DataGridTextColumn Binding="{Binding ProductModel}" Width="3*"  Header="产品型号"  ElementStyle="{StaticResource  DataGridTextColumnCenterSytle}"/>
                                <DataGridTextColumn Binding="{Binding ProductMasterModel}" Width="*"  Header="产品大类"  ElementStyle="{StaticResource  DataGridTextColumnCenterSytle}"/>
                            </DataGrid.Columns>
                        </DataGrid>

                    </Border>
                    <Grid Grid.Row="2">
                        <Label Content="入库区域:" Foreground="White" FontSize="22" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="230,47,0,0" RenderTransformOrigin="-1.095,0.883"  />
                        <ComboBox x:Name="AreaComboBox" SelectedItem="{Binding Area}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="120" FontSize="25" Foreground="White" Margin="367,42,0,0">
                            <ComboBoxItem Content="A" Foreground="Blue"/>
                            <ComboBoxItem Content="B" Foreground="Blue"/>
                            <ComboBoxItem Content="C" Foreground="Blue"/>
                        </ComboBox>
                        <Label Content="产品编码:" Foreground="White" FontSize="22" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="509,42,0,0"  />

                        <TextBox HorizontalAlignment="Left" Text="{Binding ProductCode}" Foreground="White" FontSize="22" Margin="616,38,0,0" TextWrapping="Wrap"  VerticalAlignment="Top" Width="266"/>


                        <Label Content="产品型号:" Foreground="White" FontSize="22" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="919,42,0,0"  />
                        <TextBox HorizontalAlignment="Left" Text="{Binding ProductModel}" Foreground="White" FontSize="22" Margin="1026,38,0,0" TextWrapping="Wrap"  VerticalAlignment="Top" Width="304"/>

                        <StackPanel  Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0 0 10 0">
                            <Button Content="确  认" FontSize="20" Command="{Binding SaveCommand}" CommandParameter="{Binding ElementName=window}" Background="#FF36B5C1" BorderBrush="#FF36B5C1" Foreground="white" Margin="0,0,10,0"  Height="50" Width="100"  />
                            <Button Content="取  消" FontSize="20" Command="{Binding CancelCommand}" CommandParameter="{Binding ElementName=window}" Background="#FF9900" Foreground="white" Margin="10,0,0,0" Height="50" BorderBrush="#FF9900" Width="100"  />
                        </StackPanel>

                    </Grid >

                </Grid>
            </Border>

        </Grid>
    </Border>
</Window>