<Window x:Class="SlnMesnac.WPF.Views.SetKindWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:SlnMesnac.WPF.Views" WindowStartupLocation="CenterScreen"
        xmlns:converters="clr-namespace:SlnMesnac.WPF.ConvertTo"
        mc:Ignorable="d" Background="#1157b9"
        Title="设置型号" Height="800" Width="600">
    <Window.Resources>
        <converters:BooleanToOppositeBooleanConverter x:Key="InverseBooleanConverter" />
        <Style x:Key="DataGridTextColumnCenterSytle" TargetType="{x:Type TextBlock}">
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="FontSize" Value="18"/>
        </Style>
        <Style TargetType="DataGrid">
            <!--网格线颜色-->
            <Setter Property="CanUserResizeColumns" Value="false"/>
            <Setter Property="Background" Value="#1152AC" />
            <Setter Property="BorderBrush" Value="#4285DE" />
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="HorizontalGridLinesBrush">
                <Setter.Value>
                    <SolidColorBrush Color="#4285DE"/>
                </Setter.Value>
            </Setter>
            <Setter Property="VerticalGridLinesBrush">
                <Setter.Value>
                    <SolidColorBrush Color="#1152AC"/>
                </Setter.Value>
            </Setter>
        </Style>
        <!--列头标题栏样式-->
        <Style TargetType="DataGridColumnHeader">

            <Setter Property="HorizontalContentAlignment" Value="Center" />
            <Setter Property="BorderBrush" Value="#dddddd" />
            <Setter Property="Height" Value="40"/>
            <Setter Property="FontSize" Value="18"/>
            <Setter Property="Background" Value="#4285DE"/>
            <Setter Property="Foreground" Value="White"/>
        </Style>

        <!--单元格样式-->
        <Style TargetType="DataGridCell">
            <Setter Property="FocusVisualStyle" Value="{x:Null}" />
            <Setter Property="BorderThickness" Value="0" />
            <Setter Property="BorderBrush" Value="#4285DE" />
            <Setter Property="Height" Value="40"/>
            <Setter Property="FontSize" Value="12"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type DataGridCell}">
                        <Grid Background="{TemplateBinding Background}" >
                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="IsSelected" Value="True">
                    <Setter Property="Background" Value="#4285DE"/>
                    <Setter Property="Foreground" Value="#dddddd"/>
                </Trigger>
            </Style.Triggers>

        </Style>
    </Window.Resources>
    <Border Grid.Row="1" Grid.Column="1" BorderBrush="#0288d1" BorderThickness="2" CornerRadius="5" Background="Transparent" Margin="5">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>

            <StackPanel Grid.Row="0"  Background="#1157b9" Margin="1,1,5,5" Orientation="Horizontal" >
                <TextBlock Text="型号:" FontSize="20" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="100 0 0 0"/>
                <TextBox IsReadOnly="True" Text="{Binding MaterialType}" FontSize="20" Width="241" FontWeight="Bold" Foreground="White" VerticalAlignment="Center"  Margin="10 0 0 0"/>
            </StackPanel>
            <StackPanel Grid.Row="1" Background="#1157b9" Margin="1,1,5,5" Orientation="Horizontal">
                <TextBlock Text="是否检测:" FontSize="20" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="100 0 0 0"/>

                <RadioButton Foreground="White"  Content="是" GroupName="DetectionOptions" IsChecked="{Binding IsDetectionChecked, Mode=TwoWay}" VerticalAlignment="Center" Margin="10 0 0 0"/>
                <RadioButton Foreground="White"  Content="否" GroupName="DetectionOptions" IsChecked="{Binding IsDetectionChecked, Converter={StaticResource InverseBooleanConverter}, Mode=TwoWay}" VerticalAlignment="Center" Margin="10 0 0 0"/>
            </StackPanel>
            <StackPanel Grid.Row="2"  Background="#1157b9" Margin="1,1,5,5" Orientation="Horizontal" >
                <TextBlock Text="识别特征:" FontSize="20" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="100 0 0 0"/>
                <ComboBox ItemsSource="{Binding MaterialTypes}" SelectedItem="{Binding SelectedMaterialType}" FontSize="20" Width="300" FontWeight="Bold" Foreground="LimeGreen" VerticalAlignment="Center" Margin="10 0 0 0"/>
            </StackPanel>
            <StackPanel Grid.Row="3"  Background="#1157b9" Margin="1,1,5,5" Orientation="Horizontal" >
                <TextBlock Text="灯光配置:" FontSize="20" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="100 0 0 0"/>
                <ComboBox ItemsSource="{Binding LightTypes}" SelectedItem="{Binding SelectedLightType}" FontSize="20" Width="300" FontWeight="Bold" Foreground="LimeGreen" VerticalAlignment="Center" Margin="10 0 0 0"/>
            </StackPanel>

            <StackPanel Grid.Row="4"  Background="#1157b9" Margin="1,1,5,5" Orientation="Horizontal" >
                <TextBlock Text="Ch1亮度:" FontSize="20" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="100 0 0 0"/>
                <TextBox  Text="{Binding Ch1HightText}" FontSize="20" Width="241" FontWeight="Bold" Foreground="White" VerticalAlignment="Center"  Margin="10 0 0 0"/>
            </StackPanel>

            <StackPanel Grid.Row="5"  Background="#1157b9" Margin="1,1,5,5" Orientation="Horizontal" >
                <TextBlock Text="Ch2亮度:" FontSize="20" FontWeight="Bold" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="100 0 0 0"/>
                <TextBox  Text="{Binding Ch2HightText}" FontSize="20" Width="241" FontWeight="Bold" Foreground="White" VerticalAlignment="Center"  Margin="10 0 0 0"/>
            </StackPanel>
            <Border Grid.Row="6"  Background="#1157b9" Margin="1,1,5,5"  >
                <Button Content="保 存"  Command="{Binding SaveCommand}" Width="80"
                Style="{StaticResource MaterialDesignRaisedSecondaryDarkButton}" Background="LimeGreen" HorizontalContentAlignment="Center" VerticalAlignment="Center"/>
            </Border>

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