<Window x:Class="SlnMesnac.WPF.MainWindow"
        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"
        mc:Ignorable="d"
        Title="MainWindow" Height="1080" Width="1920"
        WindowState="Maximized" WindowStyle="None" ResizeMode="NoResize" Topmost="False">
    <Window.Background>
        <ImageBrush ImageSource="/Templates/image/background.jpg" />
    </Window.Background>

    <Border Margin="5" Background="Transparent" CornerRadius="10">
        <Border.Effect>
            <DropShadowEffect Color="Gray" ShadowDepth="0" BlurRadius="5" Opacity="0.3" Direction="0"></DropShadowEffect>
        </Border.Effect>

        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="0.5*"/>
                <RowDefinition Height="7*"/>
                <RowDefinition Height="0.7*"/>
            </Grid.RowDefinitions>
            <Border Grid.Row="0" BorderBrush="Red" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="2,2">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="2*"/>
                        <ColumnDefinition Width="7*"/>
                        <ColumnDefinition Width="2*"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center">
                        <TextBlock Text="信明橡塑生产管理系统" FontSize="50" Foreground="White" FontWeight="Bold"/>
                    </StackPanel>

                    <StackPanel Grid.Column="2" VerticalAlignment="Center" HorizontalAlignment="Right">
                        <TextBlock Text="{Binding CurrentTimeText}" FontSize="20" FontWeight="Bold" Foreground="#FFFFFF" Margin="2,0,10,0"/>
                    </StackPanel>
                </Grid>

            </Border>
            <Border Grid.Row="1" BorderBrush="Red" BorderThickness="0" CornerRadius="5" Background="Transparent" Margin="2,25,2,2">
                <ContentControl Content="{Binding UserContent}"/>
            </Border>
            <Border Grid.Row="2" BorderBrush="#1254AB" BorderThickness="2" CornerRadius="5" Background="Transparent" Margin="6,2,6,7">
                <Border.Effect>
                    <DropShadowEffect Color="#1254AB" Direction="270" BlurRadius="10" ShadowDepth="5" Opacity="0.5"/>
                </Border.Effect>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="4*"/>
                        <ColumnDefinition Width="4*"/>
                        <ColumnDefinition Width="1.3*"/>
                    </Grid.ColumnDefinitions>
                    <StackPanel Grid.Column="0" VerticalAlignment="Center"  HorizontalAlignment="Left" Orientation="Horizontal">
                        <Button Content="工单执行" x:Name="Execute"  Command="{Binding ControlOnClickCommand}" CommandParameter="{Binding Name,ElementName=Execute}" Style="{StaticResource  BUTTON_AGREE}"  Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="10,0,10,0"/>
                        <Button Content="人员登录"  x:Name="Employee"  Command="{Binding ControlOnClickCommand}" CommandParameter="{Binding Name,ElementName=Employee}" Style="{StaticResource  BUTTON_AGREE}"  Width="100" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,10,0"/>
                        <Button Content="键  盘"  Command="{Binding OpenSystemKeyboardCommand}" Style="{StaticResource  BUTTON_AGREE}"  Width="100" Height="30" Background="#FF11B514" BorderBrush="#FF11B514" Margin="0,0,10,0"/>
                        <Button Content="最小化" x:Name="Minimized"  Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Minimized}" Style="{StaticResource  BUTTON_AGREE}"  Width="100" Height="30" Background="#FF9900" BorderBrush="#FF9900" Margin="0,0,10,0"/>
                        <Button Content="退  出" x:Name="Exit"  Command="{Binding FormControlCommand}" CommandParameter="{Binding Name,ElementName=Exit}" Style="{StaticResource  BUTTON_AGREE}"  Width="100" Height="30" Background="#FF0033" BorderBrush="#FF0033" Margin="0,0,10,0"/>
                    </StackPanel>
                    <StackPanel Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Right" Orientation="Horizontal">
                        <TextBlock Text="订单号" FontSize="20" Foreground="White" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,10,0"/>
                        <TextBox Text="{Binding OrderCodeText}" Height="30" Width="200" FontSize="15" Foreground="White" HorizontalAlignment="Left"  Margin="0,0,10,0"/>
                        <Button Content="确认"  x:Name="Confirm"  Command="{Binding ConfirmCommand}" CommandParameter="{Binding Name,ElementName=Employee}" Style="{StaticResource  BUTTON_AGREE}"  Width="80" Height="30" Background="#009999" BorderBrush="#FF36B5C1" Margin="0,0,30,0"/>
                        <Button Content="连　接" x:Name="Connect"  Command="{Binding ConnectCommand}" CommandParameter="{Binding Name,ElementName=Connect}" Style="{StaticResource  BUTTON_AGREE}" Width="80" Height="30" Background="#FF11B514" BorderBrush="#FF11B514" Margin="0,0,10,0"/>
                        <Button Content="断　开" x:Name="Break"  Command="{Binding BreakCommand}" CommandParameter="{Binding Name,ElementName=Connect}" Style="{StaticResource  BUTTON_AGREE}" Width="80" Height="30" Background="#FF0033" BorderBrush="#FF0033" Margin="0,0,0,0"/>
                    </StackPanel>
                    <StackPanel Grid.Column="2" VerticalAlignment="Center"  HorizontalAlignment="Right" Orientation="Horizontal">
                        <!--单行状态显示-->
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>

                            <StackPanel Grid.Column="0">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <StackPanel Grid.Column="0"/>
                                    <StackPanel Grid.Column="1"  VerticalAlignment="Center"/>
                                </Grid>
                            </StackPanel>

                            <StackPanel Grid.Column="1">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="*"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>
                                    <StackPanel Grid.Column="1">
                                        <Ellipse Width="35" Height="35" Margin="0,0,10,0">
                                            <Ellipse.Style>
                                                <Style TargetType="Ellipse">
                                                    <Style.Triggers>
                                                        <DataTrigger Binding="{Binding SerialPortDeviceStatus}" Value="0">
                                                            <Setter Property="Shape.Fill" Value="#FF9900"/>
                                                        </DataTrigger>
                                                        <DataTrigger Binding="{Binding SerialPortDeviceStatus}" Value="1">
                                                            <Setter Property="Shape.Fill" Value="#FF11B514"/>
                                                        </DataTrigger>
                                                        <DataTrigger Binding="{Binding SerialPortDeviceStatus}" Value="2">
                                                            <Setter Property="Shape.Fill" Value="#FF0033"/>
                                                        </DataTrigger>
                                                    </Style.Triggers>
                                                </Style>
                                            </Ellipse.Style>
                                        </Ellipse>
                                    </StackPanel>
                                    <StackPanel Grid.Column="0"  VerticalAlignment="Center">
                                        <TextBlock Text="条码枪连接状态" FontSize="20" Foreground="#FFFFFF" Margin="2,0,10,0"/>
                                    </StackPanel>
                                </Grid>
                            </StackPanel>
                        </Grid>
                    </StackPanel>
                </Grid>
            </Border>
        </Grid>
    </Border>
</Window>
