<UserControl x:Class="Aucma.Core.OldBoxFoam.Views.RealRoadPageView"
            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:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
             mc:Ignorable="d"   FontFamily="Microsoft YaHei"    
             d:DesignHeight="800"
             d:DesignWidth="1000" >
    <UserControl.Resources>
        <Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
            <Setter Property="FontSize" Value="20"/>
            <Setter Property="VerticalAlignment" Value="Center" />
        </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="BorderBrush" Value="#dddddd" />
            <Setter Property="Height" Value="40"/>
            <Setter Property="FontSize" Value="14"/>
            <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="Center" VerticalAlignment="Center" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="IsSelected" Value="True">
                    <Setter Property="Background" Value="#4285DE"/>
                    <Setter Property="Foreground" Value="#dddddd"/>
                </Trigger>
            </Style.Triggers>

        </Style>

        <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" />
            <!-- 重写Slider的模板 -->
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Slider}">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition />
                                <RowDefinition />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition />
                                <ColumnDefinition Width="Auto" />
                            </Grid.ColumnDefinitions>
                            <TextBox Grid.RowSpan="2" Height="Auto" Margin="0" Padding="0"  VerticalAlignment="Stretch" 
                                 VerticalContentAlignment="Center" Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Value}">
                                <!-- 给TextBox绑定上下命令 -->
                                <TextBox.InputBindings>
                                    <KeyBinding Gesture="Up" Command="{x:Static Slider.IncreaseSmall}" />
                                    <KeyBinding Gesture="Down" Command="{x:Static Slider.DecreaseSmall}" />
                                    <KeyBinding Gesture="PageUp" Command="{x:Static Slider.IncreaseLarge}" />
                                    <KeyBinding Gesture="PageDown" Command="{x:Static Slider.DecreaseLarge}" />
                                </TextBox.InputBindings>
                            </TextBox>
                            <RepeatButton Grid.Row="0" Grid.Column="1"  Command="{x:Static Slider.IncreaseSmall}"                             
                                      Style="{StaticResource RepeatButtonStyle}">
                                <Path Data="M4,0 L0,4 8,4 Z" Fill="Black" />
                            </RepeatButton>
                            <RepeatButton Grid.Row="1" Grid.Column="1" Command="{x:Static Slider.DecreaseSmall}"                            
                                      Style="{StaticResource RepeatButtonStyle}">
                                <Path Data="M0,0 L4,4 8,0 Z" Fill="Black" />
                            </RepeatButton>
                            <!-- 由于Slider的内部实现要求存在这些必要组件,所以必须保留,但是设置为隐藏即可 -->
                            <Border x:Name="TrackBackground" Visibility="Collapsed">
                                <Rectangle x:Name="PART_SelectionRange" Visibility="Collapsed" />
                            </Border>
                            <Thumb x:Name="Thumb" Visibility="Collapsed" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style TargetType="{x:Type DatePickerTextBox}">
            <Setter Property="Background" Value="#0288d1" />
        </Style>
    </UserControl.Resources>

    <Grid Margin="5">
        <Grid.Resources>
            <Style TargetType="TextBlock">
                <Setter Property="VerticalAlignment" Value="Center"/>
                <Setter Property="HorizontalAlignment" Value="Center"/>
                <Setter Property="FontSize" Value="16"/>
                <Setter Property="FontFamily" Value="微软雅黑"/>
            </Style>
            <Style TargetType="Border">
                <Setter Property="BorderBrush" Value="#0288d1"/>
                <Setter Property="BorderThickness" Value="1"/>
            </Style>
        </Grid.Resources>
        <Grid.RowDefinitions>

            <RowDefinition Height="395*"/>
            <RowDefinition Height="314*"/>
            <RowDefinition Height="81*"/>
        </Grid.RowDefinitions>


        <Border Grid.Row="0">
            <Grid>
                <Grid.Resources>
                    <Style TargetType="Border">
                        <Setter Property="BorderBrush" Value="#0288d1"/>
                        <Setter Property="BorderThickness" Value="1"/>
                    </Style>
                </Grid.Resources>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <Border Grid.Column="0" >
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="1*"/>
                            <RowDefinition Height="9*"/>
                        </Grid.RowDefinitions>
                        <Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Background="#1157b9"  Margin="1,1,5,5" >
                            <TextBlock Text="当日小时产量统计"  FontSize="20" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Border>
                        <Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" >
                            <lvc:CartesianChart Series="{Binding HourAchievement, UpdateSourceTrigger=PropertyChanged}" >

                                <lvc:CartesianChart.AxisX>
                                    <lvc:Axis Labels="{Binding HourOutPutList}" FontSize="15">
                                        <lvc:Axis.Separator>
                                            <lvc:Separator Visibility="Hidden" StrokeThickness="1.5" StrokeDashArray="0" Stroke="White" >
                                            </lvc:Separator>
                                        </lvc:Axis.Separator>
                                    </lvc:Axis>
                                </lvc:CartesianChart.AxisX>
                                <lvc:CartesianChart.AxisY>
                                    <lvc:Axis FontSize="15" MinValue="0" LabelFormatter="{Binding YAxisLabelFormatter}" >
                                        <lvc:Axis.Separator>
                                            <lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3"  Stroke="#404F56">
                                            </lvc:Separator>
                                        </lvc:Axis.Separator>
                                    </lvc:Axis>
                                </lvc:CartesianChart.AxisY>
                            </lvc:CartesianChart>
                        </Border>

                    </Grid>
                </Border>
                <Border Grid.Column="1"  >
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="1*"/>
                            <RowDefinition Height="9*"/>
                        </Grid.RowDefinitions>
                        <Border Grid.Row="0" BorderBrush="#0288d1" BorderThickness="0,0,0,1" CornerRadius="0" Background="#1157b9"  Margin="1,1,5,5" >
                            <TextBlock Text="当日型号产量统计"  FontSize="20" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                        </Border>
                        <Border Grid.Row="1" BorderBrush="#0288d1" BorderThickness="0" CornerRadius="5" Background="Transparent" >
                            <lvc:CartesianChart Series="{Binding MaterialTypeAchievement, UpdateSourceTrigger=PropertyChanged}" Margin="5">
                                <lvc:CartesianChart.AxisX>
                                    <lvc:Axis Labels="{Binding MaterialTypeOutPutList}" FontSize="15">
                                        <lvc:Axis.Separator>
                                            <lvc:Separator Visibility="Hidden" StrokeThickness="1.5" StrokeDashArray="0" Stroke="#404F56" >
                                            </lvc:Separator>
                                        </lvc:Axis.Separator>
                                    </lvc:Axis>
                                </lvc:CartesianChart.AxisX>
                                <lvc:CartesianChart.AxisY>
                                    <lvc:Axis FontSize="15" MinValue="0" LabelFormatter="{Binding YAxisLabelFormatter}">
                                        <lvc:Axis.Separator>
                                            <lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3"  Stroke="#404F56" >
                                            </lvc:Separator>
                                        </lvc:Axis.Separator>
                                    </lvc:Axis>
                                </lvc:CartesianChart.AxisY>
                            </lvc:CartesianChart>
                        </Border>
                    </Grid>
                </Border>
            </Grid>
        </Border>
        <Grid Grid.Row="1" Grid.RowSpan="2">
            <DataGrid Grid.Row="0" ItemsSource="{Binding ListItems}"   ColumnHeaderHeight="35"   Height="{Binding Path=ActualHeight, ElementName=ScanPanel}" 
                      RowHeight="50" AutoGenerateColumns="False" RowHeaderWidth="0" 
                      GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Auto" 
                      ScrollViewer.VerticalScrollBarVisibility="Auto"  BorderThickness="0" CanUserAddRows="False" SelectionMode="Single" IsReadOnly="True"
                      Foreground="White" >
                <DataGrid.Columns>
                    <DataGridTextColumn Binding="{Binding ObjId}" Header="货道号" Width="1*" ElementStyle="{StaticResource  DataGridTextColumnCenterSytle}"/>
                    <DataGridTextColumn Binding="{Binding Local}" Header="位置" Width="1*" ElementStyle="{StaticResource  DataGridTextColumnCenterSytle}"/>
                    <DataGridTemplateColumn Width="*" Header="状态">
                        <DataGridTemplateColumn.CellStyle>
                            <Style TargetType="{x:Type DataGridCell}">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding Status}" Value="1">
                                        <Setter Property="Background" Value="Red"/>
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding Status}" Value="0">
                                        <Setter Property="Background" Value="LawnGreen"/>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </DataGridTemplateColumn.CellStyle>
                    </DataGridTemplateColumn>
                    <DataGridTextColumn Binding="{Binding Boxtype}" Header="货道类型" Width="*" ElementStyle="{StaticResource  DataGridTextColumnCenterSytle}"/>
                    <DataGridTextColumn Binding="{Binding Storeamount}" Header="库存数量" Width="*" ElementStyle="{StaticResource  DataGridTextColumnCenterSytle}"/>
                    <!--<DataGridTextColumn Binding="{Binding Status}" Header="库存状态" Width="3*" ElementStyle="{StaticResource  DataGridTextColumnCenterSytle}"/>-->
                   
                    <DataGridTextColumn Binding="{Binding MaterialCode}" Header="物料编号" Width="*" ElementStyle="{StaticResource  DataGridTextColumnCenterSytle}" />
                    <DataGridTextColumn Binding="{Binding MaterialName}" Header="物料名称" Width="3*" ElementStyle="{StaticResource  DataGridTextColumnCenterSytle}" />
                    <!--<DataGridTextColumn Binding="{Binding QualityResult}" Header="模具数量" Width="*" ElementStyle="{StaticResource  DataGridTextColumnCenterSytle}"/>-->
                </DataGrid.Columns>
            </DataGrid>
            <!--<Grid.RowDefinitions>
                <RowDefinition Height="1*"/>
                <RowDefinition Height="1*"/>
                <RowDefinition Height="1*"/>
                <RowDefinition Height="1*"/>
                <RowDefinition Height="1*"/>
                <RowDefinition Height="1*"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="1*"/>
                <RowDefinition Height="1*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
                <ColumnDefinition/>
                <ColumnDefinition Width="3*"/>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Border Grid.Row="0" Grid.Column="0" >
                <TextBlock Text="货道号" Foreground="White"  FontSize="20"/>
            </Border>
            <Border Grid.Row="0" Grid.Column="1" >
                <TextBlock Text="库存状态" Foreground="White"  FontSize="20"/>
            </Border>
            <Border Grid.Row="0" Grid.Column="2" >
                <TextBlock Text="库存数量" Foreground="White"  FontSize="20"/>
            </Border>
            <Border Grid.Row="0" Grid.Column="3" >
                <TextBlock Text="产品型号" Foreground="White"  FontSize="20"/>
            </Border>
            <Border Grid.Row="0" Grid.Column="4" >
                <TextBlock Text="发泡型号" Foreground="White"  FontSize="20"/>
            </Border>
            <Border Grid.Row="0" Grid.Column="5" >
                <TextBlock Text="模具数量" Foreground="White"  FontSize="20"/>
            </Border>
            
            <Border Grid.Row="1" Grid.Column="0">
                <TextBlock Text="1"  Foreground="White" FontSize="20"/>
            </Border>
            <Border Grid.Row="2" Grid.Column="0">
                <TextBlock Text="2"  Foreground="White" FontSize="20"/>
            </Border>
            <Border Grid.Row="3" Grid.Column="0">
                <TextBlock Text="3" Foreground="White" FontSize="20"/>
            </Border>
            <Border Grid.Row="4" Grid.Column="0">
                <TextBlock Text="4"  Foreground="White" FontSize="20"/>
            </Border>
            <Border Grid.Row="5" Grid.Column="0">
                <TextBlock Text="5"  Foreground="White" FontSize="20"/>
            </Border>
            <Border Grid.Row="6" Grid.Column="0">
                <TextBlock Text="6"  Foreground="White" FontSize="20"/>
            </Border>
            <Border Grid.Row="7" Grid.Column="0">
                <TextBlock Text="7" Foreground="White" FontSize="20"/>
            </Border>
            <Border Grid.Row="8" Grid.Column="0">
                <TextBlock Text="8" Foreground="White" FontSize="20"/>
            </Border>

            <Border x:Name="Color1" Grid.Row="1" Grid.Column="1" Background="Green" >
            </Border>
            <Border x:Name="Color2" Grid.Row="2" Grid.Column="1" Background="Green" >
            </Border>
            <Border x:Name="Color3" Grid.Row="3" Grid.Column="1" Background="Green" >
            </Border>
            <Border x:Name="Color4" Grid.Row="4" Grid.Column="1" Background="Green" >
            </Border>
            <Border x:Name="Color5" Grid.Row="5" Grid.Column="1" Background="Green" >
            </Border>
            <Border x:Name="Color6" Grid.Row="6" Grid.Column="1" Background="Green" >
            </Border>
            <Border x:Name="Color7" Grid.Row="7" Grid.Column="1" Background="Green" >
            </Border>
            <Border x:Name="Color8" Grid.Row="8" Grid.Column="1" Background="Green" >
            </Border>-->


        </Grid>
    </Grid>

</UserControl>