<UserControl x:Class="SlnMesnac.WPF.Page.RecipeManagePage"
             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"
                 mc:Ignorable="d" 
             d:DesignHeight="1080" d:DesignWidth="1920" Background="Transparent">

    <Grid >

        <Grid.RowDefinitions>
            <RowDefinition Height="2*"/>
            <RowDefinition Height="4*"/>
            <RowDefinition Height="3.5*"/>
        </Grid.RowDefinitions>
        <Border  Grid.Row="0" BorderBrush="CadetBlue" BorderThickness="0.6" CornerRadius="5" Background="Transparent" Margin="1,1,5,5">
            <Grid  >
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1.0*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Column="0"  VerticalAlignment="Center" Orientation="Horizontal">
                    <TextBlock Text="缓存区重量:" FontSize="32" Foreground="White" />
                    <TextBox Text="{Binding BufferWeight}" FontSize="32" Foreground="White"  IsReadOnly="True"/>
                </StackPanel>
                <StackPanel Grid.Column="1"  VerticalAlignment="Center" Orientation="Horizontal">
                    <TextBlock Text="当前配方:" FontSize="32" Foreground="White" />
                    <TextBox Text="{Binding RecipeName}" FontSize="32" Foreground="White"  IsReadOnly="True"/>
                </StackPanel>
                <StackPanel Grid.Column="2"  VerticalAlignment="Center" Orientation="Horizontal">
                    <TextBlock Text="运行模式:" FontSize="32" Foreground="White" />
                    <TextBox Text="{Binding RecipeMode}" FontSize="32" Foreground="White" IsReadOnly="True"/>
                </StackPanel>
                <StackPanel Grid.Column="3"  VerticalAlignment="Center" Orientation="Horizontal">
                    <Button   Command="{Binding ModeChangeCommand}"  CommandParameter="auto"  Content="切换自动模式"  FontSize="25" Background="ForestGreen" Width="200"  Height="50"  Margin="0 0 0 0" />
                    <Button   Command="{Binding ModeChangeCommand}" CommandParameter="manual"  Content="切换手动模式"  FontSize="25" Background="#C4D134" Width="200"  Height="50"  Margin="50 0 0 0"  />
                </StackPanel>
            </Grid  >
        </Border>
        <Border Grid.Row="1" BorderBrush="CadetBlue" BorderThickness="0.6" CornerRadius="5" Background="Transparent" Margin="1,1,5,5">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <StackPanel Grid.Row="0"  VerticalAlignment="Center" Orientation="Horizontal">

                    <TextBox  x:Name="highSpeed1" FontSize="22" Width="120" Foreground="White"  />
                    <TextBlock Text="=&lt;高速模版重量&lt;" FontSize="22" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    <TextBox  x:Name="highSpeed2" FontSize="22" Width="120" Foreground="White"  />
                   
                    <TextBox  x:Name="midiumSpeed1" FontSize="22" Width="120" Foreground="White" Margin="80 0 0 0" />
                    <TextBlock Text="=&lt;中速模版重量&lt;" FontSize="22" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    <TextBox  x:Name="midiumSpeed2" FontSize="22" Width="120" Foreground="White"  />

                    <TextBox  x:Name="lowSpeed1" FontSize="22" Width="120" Foreground="White" Margin="80 0 0 0" />
                    <TextBlock Text="=&lt;低速模版重量&lt;" FontSize="22" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    <TextBox  x:Name="lowSpeed2" FontSize="22" Width="120" Foreground="White"  />
                    <Button  x:Name="updateWeight" Style="{StaticResource  BUTTON_AGREE}" Content="修改重量"  FontSize="22" Background="ForestGreen" Width="200"   Margin="50 0 0 0" Click="updateWeight_Click" />
                </StackPanel>
                <StackPanel Grid.Row="1"  VerticalAlignment="Center" Orientation="Horizontal">

                   
                    <TextBlock Text="拆包机螺旋--烘干机螺旋切换间隔(单位:ms)" FontSize="22" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    <TextBox  x:Name="UnpackToHotTime" FontSize="22" Width="120" Foreground="White"  />

                    <TextBlock Text="烘干机螺旋--螺旋1切换间隔(单位:ms)" FontSize="22" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="50 0 0 0"/>
                    <TextBox  x:Name="HotToSpiralTime"  FontSize="22" Width="120" Foreground="White"  />
                    
                    <TextBlock Text="螺旋1--螺旋2切换间隔(单位:ms)" FontSize="22" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="50 0 0 0"/>
                    <TextBox  x:Name="SpiralTwoTime" FontSize="22" Width="120" Foreground="White"  />
                    <Button  x:Name="updateSpiralTime" Style="{StaticResource  BUTTON_AGREE}" Content="修改时间"  FontSize="22" Background="ForestGreen" Width="200"   Margin="50 0 0 0" Click="updateSpiralTime_Click"  />
                
                </StackPanel>


            </Grid>
        </Border>
        <Border  Grid.Row="2" BorderBrush="CadetBlue" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="1,1,5,5">
            <Grid  >
                <Grid.RowDefinitions>
                    <RowDefinition Height="0.8*"/>
                    <RowDefinition Height="6*"/>
                </Grid.RowDefinitions>
                <Grid Grid.Row="0">
                    <TextBlock Text="配方管理" FontSize="30" FontWeight="Bold" Foreground="#0288d1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                </Grid>
                <Grid  Grid.Row="1">
                    <DataGrid Grid.Row="0" ItemsSource="{Binding RecipeDataGrid}" Background="Transparent"  
                      FontSize="22" ColumnHeaderHeight="55" 
                      RowHeight="60" AutoGenerateColumns="False" RowHeaderWidth="0" 
                      GridLinesVisibility="None" ScrollViewer.HorizontalScrollBarVisibility="Hidden" 
                      ScrollViewer.VerticalScrollBarVisibility="Hidden"  CanUserAddRows="False" HorizontalAlignment="Center"
                      Foreground="#FFFFFF" >
                        <!--resourceStyle 399行修改选中字体颜色-->
                        <DataGrid.Columns>
                            <DataGridTextColumn Binding="{Binding RecipeKey}" Header="配方编号" Width="*" IsReadOnly="True"/>
                            <DataGridTextColumn Binding="{Binding RecipeName}" Header="配方名称" Width="2*" IsReadOnly="True"/>
                            <DataGridTextColumn Binding="{Binding UnpackSpiral1}" Header="拆包机螺旋1频率" Width="1.5*" IsReadOnly="True"/>
                            <DataGridTextColumn Binding="{Binding UnpackSpiral2}" Header="拆包机螺旋2频率" Width="1.5*" IsReadOnly="True"/>
                            <DataGridTextColumn Binding="{Binding DryerSpiral}" Header="烘干机螺旋频率" Width="1.5*" IsReadOnly="True"/>
                            <DataGridTextColumn Binding="{Binding Spiral1}" Header="螺旋机螺旋1频率" Width="1.5*" IsReadOnly="True"/>
                            <DataGridTextColumn Binding="{Binding Spiral2}" Header="螺旋机螺旋2频率" Width="1.5*" IsReadOnly="True"/>
                            <DataGridTemplateColumn Header="操作" Width="2*">
                                <DataGridTemplateColumn.CellTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <Button Content="修改"  Style="{StaticResource  BUTTON_AGREE}"  CommandParameter="{Binding RecipeKey}" Background="#007DFA" Foreground="White" Margin="10,0,0,0" Height="45" BorderBrush="DeepSkyBlue" BorderThickness="0" Width="85" Command="{Binding DataContext.UpdateRecipeCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid  }}"/>

                                        </StackPanel>
                                    </DataTemplate>
                                </DataGridTemplateColumn.CellTemplate>

                            </DataGridTemplateColumn>
                        </DataGrid.Columns>
                    </DataGrid>
                </Grid>
                <!--<Grid.ColumnDefinitions>
                    <ColumnDefinition  Width="*"/>
                    <ColumnDefinition  Width="*"/>
                    <ColumnDefinition  Width="*"/>
                </Grid.ColumnDefinitions>-->

                <!--<Button  Grid.Row="0" Grid.Column="0"  Style="{StaticResource  BUTTON_AGREE}" Content="低速模版修改"  FontSize="25" Background="Green" Width="180" Height="50"  Margin="0,0,0,0" />
                <Button  Grid.Row="0" Grid.Column="1"  Style="{StaticResource  BUTTON_AGREE}" Content="中速模版修改"  FontSize="25" Background="Green" Width="180" Height="50"  Margin="0,0,0,0" />
                <Button  Grid.Row="0" Grid.Column="2"  Style="{StaticResource  BUTTON_AGREE}" Content="高速模版修改"  FontSize="25" Background="Green" Width="180" Height="50"  Margin="0,0,0,0" />-->


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


</UserControl>
