<UserControl x:Class="SlnMesnac.WPF.Page.LocationAndStockControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:local="clr-namespace:SlnMesnac.WPF.Page"
              xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             mc:Ignorable="d"
              d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent" Opacity="1">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="0.4*" />
            <RowDefinition Height="0.3*" />
            <RowDefinition Height="2*" />
            <RowDefinition Height="0.3*" />
            <RowDefinition Height="4*" />
        </Grid.RowDefinitions>
        <Button Grid.Row="0"  Height="50" Width="180" FontSize="22" HorizontalAlignment="Right"
Background="#009999" Foreground="White" Command="{Binding RefreshDataCommand}"
IsEnabled="{Binding DataContext.ControlsEnabled, RelativeSource={RelativeSource FindAncestor, AncestorType=Window}}"
Style="{StaticResource MaterialDesignPaperLightButton}"
ToolTip="Resource name: MaterialDesignPaperLightButton">

            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center">

                <materialDesign:PackIcon Kind="Magnify" Width="23" Height="23" Margin="5" />

                <TextBlock Text="查 询 数 据" />
            </StackPanel>
        </Button>

        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
            <TextBlock  Text="色粉库位" Foreground="#0288d1" FontSize="30" VerticalAlignment="Center" />
        </StackPanel>

        <TextBlock Grid.Row="3" Text="四宫格库位" Foreground="#0288d1" FontSize="30" HorizontalAlignment="Center" VerticalAlignment="Center" />
        <Grid Grid.Row="2">
            <Border BorderBrush="#0288d1" BorderThickness="0" CornerRadius="2" Background="Transparent">
                <DataGrid ItemsSource="{Binding TonerLocationInfoList}" Background="Transparent"
FontSize="20" ColumnHeaderHeight="45"
RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="2" CanUserAddRows="False" HorizontalAlignment="Center"
Foreground="#FFFFFF">
                    <DataGrid.Resources>
                        <Style TargetType="DataGridColumnHeader">
                            <Setter Property="Background" Value="Transparent" />
                            <Setter Property="Margin" Value="20 0 0 0" />
                            <Setter Property="Foreground" Value="#1edaf2" />
                            <Setter Property="FontWeight" Value="Bold" />

                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="DataGridColumnHeader">
                                        <Grid>
                                            <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                                            </Border>
                                        </Grid>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                        <Style TargetType="DataGridRow">
                            <Setter Property="Background" Value="Transparent" />
                            <Setter Property="Foreground" Value="#1edaf2" />
                            <Setter Property="VerticalContentAlignment" Value="Center" />
                            <Setter Property="BorderThickness" Value="2" />
                            <Style.Triggers>
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter Property="Background" Value="LightGoldenrodYellow" />
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </DataGrid.Resources>

                    <!--resourceStyle 399行修改选中字体颜色-->
                    <DataGrid.Columns>
                        <!--<DataGridTextColumn Binding="{Binding ObjId}" Header="序号" Width="1*" IsReadOnly="True" />-->
                        <DataGridTextColumn Binding="{Binding EquipName}" Header="库位名称" Width="*" IsReadOnly="True" />
                        <DataGridTextColumn Binding="{Binding WarehouseId}" Header="所属仓库" Width="*" IsReadOnly="True" />
                        <DataGridTextColumn Binding="{Binding AgvPositionCode}" Header="Agv地图编号" Width="*" IsReadOnly="True" />
                        <DataGridTextColumn Binding="{Binding ContainerCode}" Header="托盘编号" Width="*" IsReadOnly="True" />
                        <DataGridTextColumn Binding="{Binding TonerFlag}" Header="有无色粉" Width="*" IsReadOnly="True" />
                    </DataGrid.Columns>
                </DataGrid>
            </Border>
        </Grid>

        <Grid Grid.Row="4">
            <Border BorderBrush="#0288d1" BorderThickness="0" CornerRadius="2" Background="Transparent">
                <DataGrid ItemsSource="{Binding WmsBaseLocationInfoList}" Background="Transparent"
FontSize="20" ColumnHeaderHeight="45"
RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0"
GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden"
ScrollViewer.VerticalScrollBarVisibility="Hidden" BorderThickness="2" CanUserAddRows="False" HorizontalAlignment="Center"
Foreground="#FFFFFF">
                    <DataGrid.Resources>
                        <Style TargetType="DataGridColumnHeader">
                            <Setter Property="Background" Value="Transparent" />
                            <Setter Property="Margin" Value="20 0 0 0" />
                            <Setter Property="Foreground" Value="#1edaf2" />
                            <Setter Property="FontWeight" Value="Bold" />

                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="DataGridColumnHeader">
                                        <Grid>
                                            <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
                                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                                            </Border>
                                        </Grid>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                        <Style TargetType="DataGridRow">
                            <Setter Property="Background" Value="Transparent" />
                            <Setter Property="Foreground" Value="#1edaf2" />
                            <Setter Property="VerticalContentAlignment" Value="Center" />
                            <Setter Property="BorderThickness" Value="2" />
                            <Style.Triggers>
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter Property="Background" Value="LightGoldenrodYellow" />
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </DataGrid.Resources>

                    <!--resourceStyle 399行修改选中字体颜色-->
                    <DataGrid.Columns>
                        <!--<DataGridTextColumn Binding="{Binding ObjId}" Header="序号" Width="1*" IsReadOnly="True" />-->
                        <DataGridTextColumn Binding="{Binding LocationCode}" Header="库位名称" Width="1.2*" IsReadOnly="True" />
                        <DataGridTextColumn Binding="{Binding MachineCode}" Header="机台号" Width="1.3*" IsReadOnly="True" />
                        <DataGridTextColumn Binding="{Binding AgvPositionCode}" Header="Agv地图编号" Width="2*" IsReadOnly="True" />
                        <DataGridTextColumn Binding="{Binding ContainerCode}" Header="托盘编号" Width="*" IsReadOnly="True" />
                        <DataGridTextColumn Binding="{Binding Amount}" Header="库存数" Width="*" IsReadOnly="True" />
                        <DataGridTextColumn Binding="{Binding TonerFlag}" Header="库位状态" Width="*" IsReadOnly="True" />
                    </DataGrid.Columns>
                </DataGrid>
            </Border>
        </Grid>
    </Grid>
</UserControl>