<UserControl x:Class="ConeCalorimeter.Views.ConeRadiationSettingsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <UserControl.Resources>
        <Style x:Key="ValueBoxTextStyle" TargetType="TextBlock">
            <Setter Property="Height" Value="42" />
            <Setter Property="Width" Value="150" />
            <Setter Property="Padding" Value="10,5" />
            <Setter Property="FontFamily" Value="Consolas" />
            <Setter Property="FontSize" Value="24" />
            <Setter Property="FontWeight" Value="SemiBold" />
            <Setter Property="Foreground" Value="#071614" />
            <Setter Property="Background" Value="#FFFFFF" />
            <Setter Property="TextAlignment" Value="Center" />
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>

        <Style x:Key="ValueInputBoxStyle" TargetType="TextBox">
            <Setter Property="Width" Value="150" />
            <Setter Property="Height" Value="42" />
            <Setter Property="Padding" Value="10,2" />
            <Setter Property="FontFamily" Value="Consolas" />
            <Setter Property="FontSize" Value="24" />
            <Setter Property="FontWeight" Value="SemiBold" />
            <Setter Property="TextAlignment" Value="Center" />
            <Setter Property="Background" Value="#FFFFFF" />
            <Setter Property="BorderBrush" Value="#9FA9A4" />
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="VerticalContentAlignment" Value="Center" />
        </Style>

        <Style x:Key="CurrentValueTextStyle" TargetType="TextBlock">
            <Setter Property="FontFamily" Value="Consolas" />
            <Setter Property="FontSize" Value="28" />
            <Setter Property="FontWeight" Value="SemiBold" />
            <Setter Property="Foreground" Value="#071614" />
            <Setter Property="TextAlignment" Value="Center" />
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>
    </UserControl.Resources>

    <Grid Background="#F4F6F5">
        <Grid.RowDefinitions>
            <RowDefinition Height="76" />
            <RowDefinition Height="*" />
            <RowDefinition Height="24" />
        </Grid.RowDefinitions>

        <Grid Grid.Row="0"
              Margin="24,10,24,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="128" />
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="340" />
            </Grid.ColumnDefinitions>

            <Button Content="关闭"
                    Command="{Binding CloseCommand}"
                    Width="100"
                    Height="42"
                    HorizontalAlignment="Left"
                    VerticalAlignment="Top"
                    Style="{StaticResource InstrumentButtonStyle}" />

            <TextBlock Grid.Column="1"
                       Text="辐射锥设置"
                       FontSize="34"
                       FontWeight="SemiBold"
                       Foreground="#101817"
                       HorizontalAlignment="Center"
                       VerticalAlignment="Top" />

            <StackPanel Grid.Column="2"
                        Orientation="Horizontal"
                        HorizontalAlignment="Right"
                        VerticalAlignment="Top">
                <Button Content="帮助"
                        Command="{Binding HelpCommand}"
                        Width="100"
                        Height="42"
                        Style="{StaticResource InstrumentButtonStyle}" />
                <StackPanel Margin="26,0,0,0"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center">
                    <Ellipse Width="34"
                             Height="34"
                             Stroke="#8C9691"
                             StrokeThickness="1">
                        <Ellipse.Style>
                            <Style TargetType="Ellipse">
                                <Setter Property="Fill" Value="#A7AFAB" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding GreenLampActive}" Value="True">
                                        <Setter Property="Fill" Value="#2EA35A" />
                                        <Setter Property="Stroke" Value="#1D6939" />
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding YellowLampActive}" Value="True">
                                        <Setter Property="Fill" Value="#F2C230" />
                                        <Setter Property="Stroke" Value="#8B6A00" />
                                    </DataTrigger>
                                    <DataTrigger Binding="{Binding RedLampActive}" Value="True">
                                        <Setter Property="Fill" Value="#E41F2C" />
                                        <Setter Property="Stroke" Value="#8E111A" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Ellipse.Style>
                    </Ellipse>
                    <TextBlock Text="{Binding LampStatusText}"
                               FontSize="12"
                               Foreground="#40504B"
                               HorizontalAlignment="Center" />
                </StackPanel>
            </StackPanel>
        </Grid>

        <Border Grid.Row="0"
                Height="1"
                Margin="24,0"
                Background="#C9D0CC"
                VerticalAlignment="Bottom" />

        <Grid Grid.Row="1"
              Margin="24,24,24,0">
            <Border Background="White"
                    BorderBrush="#D2D8D5"
                    BorderThickness="1"
                    CornerRadius="6"
                    Padding="34,28">
                <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>

                <StackPanel Grid.Row="0"
                            Grid.Column="0"
                            HorizontalAlignment="Center"
                            Margin="0,0,24,24">
                    <TextBlock Text="当前辐射温度："
                               FontSize="24"
                               FontWeight="SemiBold"
                               Foreground="#172321" />
                    <Grid Margin="0,8,0,10">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="150" />
                            <ColumnDefinition Width="16" />
                            <ColumnDefinition Width="76" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <TextBlock Text="{Binding CurrentTemperatureText}"
                                   Grid.Column="1"
                                   Style="{StaticResource CurrentValueTextStyle}" />
                        <TextBlock Grid.Column="3"
                                   Text="°C"
                                   FontSize="24"
                                   VerticalAlignment="Center" />
                    </Grid>
                </StackPanel>

                <StackPanel Grid.Row="0"
                            Grid.Column="1"
                            HorizontalAlignment="Center"
                            Margin="24,0,0,24">
                    <TextBlock Text="当前热通量："
                               FontSize="24"
                               FontWeight="SemiBold"
                               Foreground="#172321" />
                    <Grid Margin="0,8,0,10">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="150" />
                            <ColumnDefinition Width="16" />
                            <ColumnDefinition Width="76" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <TextBlock Text="{Binding CurrentHeatFluxText}"
                                   Grid.Column="1"
                                   Style="{StaticResource CurrentValueTextStyle}" />
                        <TextBlock Grid.Column="3"
                                   Text="KW"
                                   FontSize="24"
                                   VerticalAlignment="Center" />
                    </Grid>
                </StackPanel>

                <StackPanel Grid.Row="1"
                            Grid.Column="0"
                            HorizontalAlignment="Center"
                            Margin="0,8,24,24">
                    <TextBlock Text="设置辐射温度："
                               FontSize="24"
                               FontWeight="SemiBold"
                               Foreground="#172321" />
                    <Grid Margin="0,8,0,6">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="150" />
                            <ColumnDefinition Width="16" />
                            <ColumnDefinition Width="76" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <TextBox Text="{Binding TargetTemperatureText, UpdateSourceTrigger=PropertyChanged}"
                                 Grid.Column="1"
                                 Style="{StaticResource ValueInputBoxStyle}"
                                 GotKeyboardFocus="ConeParameterTextBox_GotKeyboardFocus"
                                 LostKeyboardFocus="ConeParameterTextBox_LostKeyboardFocus" />
                        <TextBlock Grid.Column="3"
                                   Text="°C"
                                   FontSize="24"
                                   VerticalAlignment="Center" />
                    </Grid>
                </StackPanel>

                <StackPanel Grid.Row="1"
                            Grid.Column="1"
                            HorizontalAlignment="Center"
                            Margin="24,8,0,24">
                    <TextBlock Text="热传递："
                               FontSize="24"
                               FontWeight="SemiBold"
                               Foreground="#172321" />
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="*" />
                            <ColumnDefinition Width="150" />
                            <ColumnDefinition Width="16" />
                            <ColumnDefinition Width="76" />
                            <ColumnDefinition Width="12" />
                            <ColumnDefinition Width="120" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <TextBox Text="{Binding HeatTransferText, UpdateSourceTrigger=PropertyChanged}"
                                 Grid.Column="1"
                                 Style="{StaticResource ValueInputBoxStyle}"
                                 GotKeyboardFocus="ConeParameterTextBox_GotKeyboardFocus"
                                 LostKeyboardFocus="ConeParameterTextBox_LostKeyboardFocus" />
                        <TextBlock Grid.Column="3"
                                   Text="KW/M*k"
                                   FontSize="18"
                                   VerticalAlignment="Center" />
                        <Button Grid.Column="5"
                                Content="保存"
                                Command="{Binding SaveParametersCommand}"
                                Height="42"
                                Style="{StaticResource InstrumentButtonStyle}"
                                VerticalAlignment="Center" />
                    </Grid>
                </StackPanel>

                <StackPanel Grid.Row="2"
                            Grid.ColumnSpan="2"
                            Orientation="Horizontal"
                            HorizontalAlignment="Center"
                            Margin="0,14,0,0">
                    <Button Content="{Binding StartHeatingButtonText}"
                            Command="{Binding ActionCommand}"
                            CommandParameter="开始升温"
                            Width="140"
                            Height="42"
                            Margin="0,0,10,0">
                        <Button.Style>
                            <Style TargetType="Button"
                                   BasedOn="{StaticResource InstrumentPrimaryButtonStyle}">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding HeatingActive}" Value="True">
                                        <Setter Property="Background" Value="#FDE8D0" />
                                        <Setter Property="BorderBrush" Value="#C86F12" />
                                        <Setter Property="Foreground" Value="#5C2D00" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Button.Style>
                    </Button>
                    <Button Content="停止升温"
                            Command="{Binding ActionCommand}"
                            CommandParameter="停止升温"
                            Width="140"
                            Height="42"
                            Margin="0,0,10,0"
                            Style="{StaticResource InstrumentButtonStyle}" />
                    <Button Content="循环水"
                            Command="{Binding ActionCommand}"
                            CommandParameter="循环水"
                            Width="140"
                            Height="42">
                        <Button.Style>
                            <Style TargetType="Button"
                                   BasedOn="{StaticResource InstrumentButtonStyle}">
                                <Setter Property="Background" Value="#EEF1EF" />
                                <Setter Property="BorderBrush" Value="#A9B1AD" />
                                <Setter Property="Foreground" Value="#172320" />
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding CirculatingWaterActive}" Value="True">
                                        <Setter Property="Background" Value="#2F8F5B" />
                                        <Setter Property="BorderBrush" Value="#236A45" />
                                        <Setter Property="Foreground" Value="#FFFFFF" />
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Button.Style>
                    </Button>
                </StackPanel>
            </Grid>
            </Border>
        </Grid>
    </Grid>
</UserControl>
