<Window x:Class="ShanghaiEnvironmentalTechnology.Window6"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:oxy="http://oxyplot.org/wpf"
        Title="{DynamicResource Manual}" WindowState="Maximized"   Height="768" Width="1024"
        WindowStartupLocation="CenterScreen" Loaded="Window_Loaded"
        Background="#F5F7FA" >
    <Window.Resources>

        <!-- 按钮样式 -->
        <Style x:Key="MyButtonStyle" TargetType="Button">
            <Setter Property="Background" Value="#4A90E2"/>
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="Margin" Value="5"/>
            <Setter Property="Padding" Value="8,4"/>
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="Cursor" Value="Hand"/>
            <Setter Property="Height" Value="30"/>
            <Setter Property="Width" Value="160"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border Background="{TemplateBinding Background}" CornerRadius="15">
                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="#3A7BBE"/>
                </Trigger>
                <Trigger Property="IsPressed" Value="True">
                    <Setter Property="Background" Value="#2A5E9A"/>
                </Trigger>
            </Style.Triggers>
        </Style>

        <!-- 文本框样式 -->
        <Style x:Key="MyTextBoxStyle" TargetType="TextBox">
            <Setter Property="Background" Value="#FFFFFF"/>
            <Setter Property="Foreground" Value="Black"/>
            <Setter Property="BorderBrush" Value="#4A90E2"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Padding" Value="5,5"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="Height" Value="30"/>
            <Setter Property="Width" Value="80"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="TextBox">
                        <Border Background="{TemplateBinding Background}" 
                                BorderBrush="{TemplateBinding BorderBrush}" 
                                BorderThickness="{TemplateBinding BorderThickness}" 
                                CornerRadius="15">
                            <ScrollViewer x:Name="PART_ContentHost"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- 标题样式 -->
        <Style x:Key="SectionTitleStyle" TargetType="TextBlock">
            <Setter Property="FontSize" Value="16"/>
            <Setter Property="FontWeight" Value="Medium"/>
            <Setter Property="Foreground" Value="#333333"/>
            <Setter Property="Margin" Value="0,0,0,10"/>
        </Style>

        <!-- 参数项标签样式 -->
        <Style x:Key="ParamLabelStyle" TargetType="TextBlock">
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="Foreground" Value="#666666"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Width" Value="160"/>
        </Style>

        <!-- 单位文本样式 -->
        <Style x:Key="UnitTextStyle" TargetType="TextBlock">
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="Foreground" Value="#999999"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Margin" Value="5,0"/>
        </Style>
    </Window.Resources>

    <!-- 使用DockPanel确保区域不重叠 -->
    <DockPanel LastChildFill="True">
        <!-- 1. 顶部标题区 - 停靠在顶部 -->
        <Border DockPanel.Dock="Top" Height="60" Background="#4A90E2" CornerRadius="8" Margin="20,20,20,0">
            <TextBlock Text="{DynamicResource Manual}" 
                       HorizontalAlignment="Center" 
                       VerticalAlignment="Center" 
                       FontSize="24" 
                       Foreground="White"
                       FontWeight="Medium"/>
        </Border>

        <!-- 2. 底部导航区 - 停靠在底部 -->
        <Border DockPanel.Dock="Bottom" Height="60" Background="White" 
                BorderBrush="#E0E0E0" BorderThickness="1" 
                CornerRadius="8" Margin="20,0,20,20">
            <StackPanel Orientation="Horizontal" 
                        HorizontalAlignment="Center" 
                        VerticalAlignment="Center">
                <Button Content="{DynamicResource Deformation}" Style="{StaticResource MyButtonStyle}" Width="120" Click="Button_Click_2"/>
                <Button Content="{DynamicResource Manual191}" Style="{StaticResource MyButtonStyle}" Width="120" Click="Button_Click_1"/>
                <!--<Button Content="曲线" Style="{StaticResource MyButtonStyle}" Width="120"/>-->
                <!--<Button Content="手动界面" Style="{StaticResource MyButtonStyle}" Width="120" Background="#3A7BBE"/>-->
                <Button Content="{DynamicResource test28}" Style="{StaticResource MyButtonStyle}" Width="130" Click="Button_Click_3"/>
            </StackPanel>
        </Border>

        <!-- 3. 中间内容区 - 填充剩余空间 -->
        <Grid Margin="20,10,20,10">
            <Grid.ColumnDefinitions>
                <!--<ColumnDefinition Width="1*"/>-->
                <ColumnDefinition Width="1.2*"/>
                <ColumnDefinition Width="1.2*"/>
            </Grid.ColumnDefinitions>

            <!-- 左侧参数区 -->
            <Grid Grid.Column="0" Margin="10">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="30"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>

                <!-- 第一组：基础参数 -->
                <TextBlock Text="{DynamicResource Manual24}" Style="{StaticResource SectionTitleStyle}" Grid.Row="0"/>
                <Grid Grid.Row="1">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="40"/>
                        <RowDefinition Height="40"/>
                        <RowDefinition Height="40"/>
                        <RowDefinition Height="40"/>
                        <RowDefinition Height="40"/>

                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>

                    <!-- 手动速度 -->
                    <TextBlock Text="{DynamicResource Manual1}" Style="{StaticResource ParamLabelStyle}" Grid.Row="0" Grid.Column="0" Margin="5"/>
                    <TextBox Name="handmovementTxt" Style="{StaticResource MyTextBoxStyle}" Grid.Row="0" Grid.Column="1" 
         
                             IsReadOnly="True"
                          />

                    <!--<TextBlock Text="mm/min" Style="{StaticResource UnitTextStyle}" Grid.Row="0" Grid.Column="2"/>-->
                    <Button Name="btn1" Content="{DynamicResource Manual3}" Style="{StaticResource MyButtonStyle}" Width="60" Click="Button_Click_14" Grid.Row="0" Grid.Column="3"/>

                    <!-- 潮气量系数 -->
                    <TextBlock Text="{DynamicResource Manual4}" Style="{StaticResource ParamLabelStyle}" Grid.Row="1" Grid.Column="0" Margin="5"/>
                    <TextBox Name="moistureTxt" Style="{StaticResource MyTextBoxStyle}" Grid.Row="1" Grid.Column="1"   
IsReadOnly="True"
                           />

                    <Button Name="btn2" Content="{DynamicResource Manual3}" Style="{StaticResource MyButtonStyle}" Width="60" Click="Button_Click_15"  Grid.Row="1" Grid.Column="3"/>


                    <!-- 呼气流量系数 -->
                    <TextBlock Text="{DynamicResource Manual5}" Style="{StaticResource ParamLabelStyle}" Grid.Row="2" Grid.Column="0" Margin="5"/>
                    <TextBox Name="OutFowRateTxt" Style="{StaticResource MyTextBoxStyle}" Grid.Row="2" Grid.Column="1" 
IsReadOnly="True"
                          />

                    <Button Name="btn3" Content="{DynamicResource Manual3}" Style="{StaticResource MyButtonStyle}" Width="60" Click="Button_Click_16"  Grid.Row="2" Grid.Column="3"/>

                    <!--<TextBlock Text="L/min" Style="{StaticResource UnitTextStyle}" Grid.Row="2" Grid.Column="2"/>-->

                    <!-- 吸气流量系数 -->
                    <TextBlock Text="{DynamicResource Manual6}" Style="{StaticResource ParamLabelStyle}" Grid.Row="3" Grid.Column="0" Margin="5"/>
                    <TextBox Name="InFowRateTxt" Style="{StaticResource MyTextBoxStyle}" Grid.Row="3" Grid.Column="1" 
  IsReadOnly="True"
                            />

                    <Button Name="btn4" Content="{DynamicResource Manual3}" Style="{StaticResource MyButtonStyle}" Width="60" Click="Button_Click_17"  Grid.Row="3" Grid.Column="3"/>

                    <!--<TextBlock Text="L/min" Style="{StaticResource UnitTextStyle}" Grid.Row="3" Grid.Column="2"/>-->


                    <!-- 压力系数 -->
                    <TextBlock Text="{DynamicResource Manual7}" Style="{StaticResource ParamLabelStyle}" Grid.Row="4" Grid.Column="0" Margin="5"/>
                    <TextBox Name="PressRateTxt" Style="{StaticResource MyTextBoxStyle}" Grid.Row="4" Grid.Column="1" 
IsReadOnly="True"
                           />

                    <Button Name="btn5" Content="{DynamicResource Manual3}" Style="{StaticResource MyButtonStyle}" Width="60" Click="Button_Click_18"  Grid.Row="4" Grid.Column="3"/>

                    <!--<TextBlock Text="L/min" Style="{StaticResource UnitTextStyle}" Grid.Row="4" Grid.Column="2"/>-->




                </Grid>

                <!-- 第二组：实时监测参数 -->
                <TextBlock Text="{DynamicResource Manual8}" Style="{StaticResource SectionTitleStyle}" Grid.Row="3"/>
                <Grid Grid.Row="4">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="40"/>
                        <RowDefinition Height="40"/>
                        <RowDefinition Height="40"/>
                        <RowDefinition Height="40"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>

                    <!-- 位置 -->
                    <TextBlock Text="{DynamicResource Manual9}" Style="{StaticResource ParamLabelStyle}" Grid.Row="0" Grid.Column="0" Margin="5"/>
                    <TextBox Name="positionTxt" Style="{StaticResource MyTextBoxStyle}" Grid.Row="0" Grid.Column="1" IsReadOnly="True" Background="#F0F0F0"/>
                    <TextBlock Text="mm" Style="{StaticResource UnitTextStyle}" Grid.Row="0" Grid.Column="2"/>

                    <!-- 压力 -->
                    <TextBlock Text="{DynamicResource Manual10}" Style="{StaticResource ParamLabelStyle}" Grid.Row="1" Grid.Column="0" Margin="5"/>
                    <TextBox Name="pressTxt" Style="{StaticResource MyTextBoxStyle}" Grid.Row="1" Grid.Column="1" IsReadOnly="True" Background="#F0F0F0"/>
                    <TextBlock Text="pa" Style="{StaticResource UnitTextStyle}" Grid.Row="1" Grid.Column="2"/>

                    <!-- 呼气流量 -->
                    <TextBlock Text="{DynamicResource Manual11}" Style="{StaticResource ParamLabelStyle}" Grid.Row="2" Grid.Column="0" Margin="5"/>
                    <TextBox Name="OutFowTxt" Style="{StaticResource MyTextBoxStyle}" Grid.Row="2" Grid.Column="1"   IsReadOnly="True" Background="#F0F0F0"/>
                    <TextBlock Text="L/min" Style="{StaticResource UnitTextStyle}" Grid.Row="2" Grid.Column="2"/>

                    <!-- 吸气流量 -->
                    <TextBlock Text="{DynamicResource Manual12}" Style="{StaticResource ParamLabelStyle}" Grid.Row="3" Grid.Column="0" Margin="5"/>
                    <TextBox Name="InFlowTxt" Style="{StaticResource MyTextBoxStyle}" Grid.Row="3" Grid.Column="1" IsReadOnly="True" Background="#F0F0F0"/>
                    <TextBlock Text="L/min" Style="{StaticResource UnitTextStyle}" Grid.Row="3" Grid.Column="2"/>
                </Grid>
            </Grid>

            <!-- 中间预留区 -->
            <!--<Grid Grid.Column="1" Margin="10">
                <Border Background="White" 
            BorderBrush="#E0E0E0" 
            BorderThickness="1" 
            CornerRadius="8"
            Margin="10">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>
                        <StackPanel Orientation="Horizontal" Grid.Row="0" HorizontalAlignment="Center">
                            <Rectangle Width="20" Height="20" Fill="Red" Margin="5"/>
                            <TextBlock Text="{DynamicResource Manual11}" Foreground="#999999" FontSize="16" VerticalAlignment="Center" />
                            <Rectangle Width="20" Height="20" Fill="Blue" Margin="5"/>
                            <TextBlock Text="{DynamicResource Manual12}" Foreground="#999999" FontSize="16" VerticalAlignment="Center" />
                        </StackPanel>
                        <oxy:PlotView x:Name="plotView" 
                          Margin="10" 
                          Grid.Row="1" />
                    </Grid>
                </Border>
            </Grid>-->







            <!-- 右侧操作区 -->
            <Grid Grid.Column="1" Margin="10">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="30"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>

                <!-- 操作按钮标题 -->
                <!--<TextBlock Text="{DynamicResource Manual19}" Style="{StaticResource SectionTitleStyle}" />-->

                <!-- 控制按钮组 -->
                <StackPanel Grid.Row="1" Margin="0,0,0,10">
                    <Button Content="{DynamicResource Manual13}" Style="{StaticResource MyButtonStyle}" Click="Button_Click_4"/>
                    <Button Content="{DynamicResource Manual14}" Style="{StaticResource MyButtonStyle}" Click="Button_Click_5"/>
                    <Button Content="{DynamicResource Manual15}" Style="{StaticResource MyButtonStyle}" Click="Button_Click_6"/>
                    <Button Content="{DynamicResource Manual16}" Style="{StaticResource MyButtonStyle}" Click="Button_Click_7"/>
                    <Button Content="{DynamicResource Manual17}" Style="{StaticResource MyButtonStyle}" Click="Button_Click_8"/>
                    <Button Content="{DynamicResource Manual171}" Style="{StaticResource MyButtonStyle}" Click="Button_Click_9"/>
                    <Button Name="ResetBtn" Content="{DynamicResource Manual18}" Style="{StaticResource MyButtonStyle}" Background="#F5A623" Click="Button_Click_10"/>
                </StackPanel>

                <!-- 校准按钮标题 -->
                <!--<TextBlock Text="{DynamicResource Manual20}" Style="{StaticResource SectionTitleStyle}" Grid.Row="3"/>-->

                <!-- 校准按钮组 -->
                <StackPanel Grid.Row="4">
                    <Button Content="{DynamicResource Manual21}" Style="{StaticResource MyButtonStyle}" Click="Button_Click_11"/>
                    <Button Content="{DynamicResource Manual22}" Style="{StaticResource MyButtonStyle}" Click="Button_Click_12"/>
                    <Button Content="{DynamicResource Manual23}" Style="{StaticResource MyButtonStyle}" Click="Button_Click_13"/>
                </StackPanel>
            </Grid>
        </Grid>
    </DockPanel>
</Window>
