<Window x:Class="ShanghaiEnvironmentalTechnology.Window2"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="{DynamicResource Next}" WindowState="Maximized"   Height="768" Width="1024"
        Loaded="Window_Loaded" WindowStartupLocation="CenterScreen">

    <Window.Resources>

        <Style x:Key="MyButtonStyle" TargetType="Button">
            <Setter Property="Background" Value="#4A90E2"/>
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="FontSize" Value="16"/>
            <Setter Property="Margin" Value="10"/>
            <Setter Property="Padding" Value="10,5"/>
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="Cursor" Value="Hand"/>
            <Setter Property="Height" Value="40"/>
            <Setter Property="Width" Value="120"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border Background="{TemplateBinding Background}" CornerRadius="20">
                            <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="2"/>
            <Setter Property="Padding" Value="10,10"/>
            <Setter Property="FontSize" Value="18"/>
            <Setter Property="Height" Value="50"/>
            <!-- 增加高度 -->
            <Setter Property="Width" Value="120"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <!-- 垂直居中 -->
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="TextBox">
                        <Border Background="{TemplateBinding Background}" 
                                BorderBrush="{TemplateBinding BorderBrush}" 
                                BorderThickness="{TemplateBinding BorderThickness}" 
                                CornerRadius="20">
                            <ScrollViewer x:Name="PART_ContentHost"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style TargetType="TextBlock">
            <Setter Property="FontSize" Value="18"/>
            <Setter Property="Foreground" Value="Black"/>
            <Setter Property="Margin" Value="5"/>
        </Style>

    </Window.Resources>

    <Grid Margin="20">
        <TextBlock Text="" FontSize="18" HorizontalAlignment="Left" Margin="0,0,0,0"  Foreground="Black"/>
        <StackPanel VerticalAlignment="Top" HorizontalAlignment="Center" Width="1366">

            <TextBlock Text="{DynamicResource Next}" FontSize="24" FontWeight="Bold" HorizontalAlignment="Center" Margin="0,0,0,20"  Foreground="Black"/>

            <StackPanel Orientation="Vertical" Margin="0,10" HorizontalAlignment="Center">

                <Grid Margin="0,10" HorizontalAlignment="Center" Width="Auto">

                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="120"/>
                        <!-- 标签列 -->
                        <ColumnDefinition Width="120"/>
                        <!-- 输入框+单位列 -->
                        <ColumnDefinition Width="*"/>
                        <!-- 按钮列 -->
                    </Grid.ColumnDefinitions>

                    <TextBlock Text="{DynamicResource Peak force test result(N)}" VerticalAlignment="Center" Foreground="Black" Margin="{DynamicResource Margin1}"/>

                    <StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
                        <TextBox Name="RealTimePressureTextBox" Width="80" Style="{StaticResource MyTextBoxStyle}" Margin="0" IsEnabled="false"/>
                        <TextBlock Text="pa" VerticalAlignment="Center" Foreground="Black" Margin="5,0,0,0"/>
                    </StackPanel>

                    <Button  Name="btnlianjiekou"  Grid.Column="2" Content="{DynamicResource Deformation2}" Width="250" Style="{StaticResource MyButtonStyle}" Click="Button_Click" HorizontalAlignment="Left"/>
                </Grid>

                <!-- 鼻口压力行 -->
                <Grid Margin="0,10" HorizontalAlignment="Center" Width="400">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="120"/>
                        <ColumnDefinition Width="120"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>

                    <TextBlock Text="{DynamicResource TestResults}" VerticalAlignment="Center" Foreground="Black"  Margin="{DynamicResource Margin2}"/>

                    <StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center">
                        <TextBox Name="NoseTxt" Width="80" Style="{StaticResource MyTextBoxStyle}" Foreground="Black" IsEnabled="false"  Margin="-50"  />
                        <TextBlock Text="pa" VerticalAlignment="Center" Foreground="Black" Margin="50,0,0,0"/>
                    </StackPanel>

                    <Button Name="btnjiaozhun" Grid.Column="2" Content="{DynamicResource Calibration}" Style="{StaticResource MyButtonStyle}" Click="Button_Click_1" HorizontalAlignment="Left"/>
                </Grid>

                <!-- 设定流量行 -->
                <Grid Margin="0,10" HorizontalAlignment="Center" Width="400">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="120"/>
                        <ColumnDefinition Width="120"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>

                    <TextBlock Text="{DynamicResource Deformation1}" VerticalAlignment="Center" Foreground="Black" Margin="{DynamicResource Margin3}"/>

                    <StackPanel Grid.Column="1" Orientation="Horizontal" VerticalAlignment="Center" Width="Auto">
                        <TextBox Name="FowlTxt1" Width="100" Style="{StaticResource MyTextBoxStyle}" Foreground="Black" IsReadOnly="True" Margin="-35" />
                        <TextBlock Text="L/min" VerticalAlignment="Center" Foreground="Black" Margin="40,0,0,0"/>
                    </StackPanel>

                    <Button Name="btnsetting" Grid.Column="2" Content="{DynamicResource Deformation4}" Style="{StaticResource MyButtonStyle}" Click="Button_Click_7" HorizontalAlignment="Center"/>
                </Grid>
            </StackPanel>

            <TextBlock Text="{DynamicResource Deformation5}" FontSize="20" HorizontalAlignment="Center" Margin="0,20"  Foreground="Black"/>
            <TextBlock x:Name="flowTxt" Text="???" FontSize="24" Foreground="Red" HorizontalAlignment="Center"/>
            <TextBlock Text="L/min" HorizontalAlignment="Center"  Foreground="Black"/>

            <StackPanel Orientation="Horizontal" Margin="0,20" HorizontalAlignment="Center">

                <Button Content="{DynamicResource Deformation6}" Style="{StaticResource MyButtonStyle}" Width="180" Click="Button_Click_2" />


                <TextBox Name="AirTxt" Width="80" Margin="10,0" Style="{StaticResource MyTextBoxStyle}"  IsEnabled="False"/>
                <TextBlock Text="hpa" VerticalAlignment="Center"  Foreground="Black"/>
            </StackPanel>

            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,30">
                <Button Content="{DynamicResource Deformation}" Style="{StaticResource MyButtonStyle}"  Click="Button_Click_3"/>
                <Button Name="TestStartButton" Content="{DynamicResource Maximumforcevaluetestresult(N)}" Style="{StaticResource MyButtonStyle}"  Click="Button_Click_4"/>
                <Button Content="{DynamicResource Deformation test results}" Style="{StaticResource MyButtonStyle}" Click="Button_Click_5" />
                <Button Content="{DynamicResource ViewReport}" Style="{StaticResource MyButtonStyle}"  Click="Button_Click_6"/>
            </StackPanel>
        </StackPanel>
    </Grid>
</Window>
