<UserControl x:Class="ConeCalorimeter.Views.SmokeDensitySettingsView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Grid Background="#F4F6F5">
        <Border Margin="24"
                Padding="20"
                Background="#FBFCFB"
                BorderBrush="#C9D0CC"
                BorderThickness="1"
                CornerRadius="6">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="74" />
                    <RowDefinition Height="84" />
                    <RowDefinition Height="88" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>

                <Grid Grid.Row="0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="130" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="130" />
                    </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" />
                </Grid>

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

                <StackPanel Grid.Row="1"
                            Margin="28,18,0,0"
                            Orientation="Horizontal"
                            VerticalAlignment="Top">
                    <TextBlock Text="吸光率："
                               FontSize="24"
                               FontWeight="SemiBold"
                               Foreground="#182522"
                               VerticalAlignment="Center" />
                    <TextBlock Text="{Binding AbsorbanceText}"
                               Margin="22,0,0,0"
                               FontFamily="Consolas"
                               FontSize="24"
                               FontWeight="SemiBold"
                               Foreground="#071614"
                               VerticalAlignment="Center" />
                    <TextBlock Text="%"
                               Margin="14,0,0,0"
                               FontSize="22"
                               Foreground="#182522"
                               VerticalAlignment="Center" />
                </StackPanel>

                <ItemsControl Grid.Row="2"
                              ItemsSource="{Binding CalibrationActions}">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <WrapPanel Orientation="Horizontal" />
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <Button Content="{Binding Label}"
                                    PreviewMouseLeftButtonDown="CalibrationButton_PreviewMouseLeftButtonDown"
                                    PreviewMouseLeftButtonUp="CalibrationButton_PreviewMouseLeftButtonUp"
                                    MouseLeave="CalibrationButton_MouseLeave"
                                    LostMouseCapture="CalibrationButton_LostMouseCapture"
                                    TouchDown="CalibrationButton_TouchDown"
                                    TouchUp="CalibrationButton_TouchUp"
                                    TouchLeave="CalibrationButton_TouchLeave"
                                    LostTouchCapture="CalibrationButton_LostTouchCapture"
                                    Width="128"
                                    Height="42"
                                    Margin="0,8,24,8"
                                    Style="{StaticResource InstrumentButtonStyle}" />
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>

                <StackPanel Grid.Row="3"
                            Margin="0,26,0,0">
                    <TextBlock Text="帮助："
                               FontSize="22"
                               FontWeight="SemiBold"
                               Foreground="#1B2826" />
                    <TextBlock Margin="0,22,0,0"
                               Text="1. 0%为不遮光校准；"
                               FontSize="22"
                               Foreground="#111A18" />
                    <TextBlock Margin="0,14,0,0"
                               Text="2. 25%为放入25%遮光片校准；"
                               FontSize="22"
                               Foreground="#111A18" />
                    <TextBlock Margin="0,14,0,0"
                               Text="3. 50%为放入50%遮光片校准；"
                               FontSize="22"
                               Foreground="#111A18" />
                    <TextBlock Margin="0,14,0,0"
                               Text="4. 75%为放入75%遮光片校准；"
                               FontSize="22"
                               Foreground="#111A18" />
                    <TextBlock Margin="0,14,0,0"
                               Text="5. 100%为堵光校准；"
                               FontSize="22"
                               Foreground="#111A18" />
                    <TextBlock Text="{Binding LastCalibration, StringFormat=最近校准：{0}}"
                               Margin="0,28,0,0"
                               FontSize="18"
                               Foreground="#53615C" />
                </StackPanel>
            </Grid>
        </Border>
    </Grid>
</UserControl>
