<Page x:Class="CCDCountWpf.WpfPage.MainPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:local="clr-namespace:CCDCountWpf.WpfPage"
      mc:Ignorable="d"
      Title="MainPage" Height="503" Width="876" Loaded="Page_Loaded">

    <Grid>
        <Grid Margin="0,0,0,187" SizeChanged="Grid_SizeChanged">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Border Grid.Column="0" BorderBrush="Black" BorderThickness="1" Margin="2,2,2,2">
                <Image x:Name="ShowBox"  Source="{Binding BitmapImage}" Margin="0,0,0,0"/>
            </Border>
            <Border Grid.Column="1" BorderBrush="Black" BorderThickness="1" Margin="2,2,2,2">
                <StackPanel  Orientation="Vertical">
                    <Image x:Name="MiniShowImageBox1"  Source="{Binding ThumbnailImage1}" Margin="3,5,3,5" MouseDown="MiniShowImageBox1_MouseDown" />
                    <Image x:Name="MiniShowImageBox2"  Source="{Binding ThumbnailImage2}" Margin="3,5,3,5" MouseDown="MiniShowImageBox2_MouseDown" />
                    <Image x:Name="MiniShowImageBox3"  Source="{Binding ThumbnailImage3}" Margin="3,5,3,5" MouseDown="MiniShowImageBox3_MouseDown"/>
                    <Image x:Name="MiniShowImageBox4"  Source="{Binding ThumbnailImage4}" Margin="3,5,3,5" MouseDown="MiniShowImageBox4_MouseDown"/>
                </StackPanel>
            </Border>
        </Grid>
        
        <Grid Margin="0,0,0,10" Height="170" VerticalAlignment="Bottom">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>

            <Border Grid.Column="0" 
                    Background="#B20092FF" 
                    CornerRadius="8"
                    BorderBrush="Gray"
                    BorderThickness="1"
                    Margin="15,10,15,0" Height="155" VerticalAlignment="Top">

                <StackPanel Orientation="Horizontal">
                    <StackPanel Orientation="Vertical">
                        <Label  Content="当前总粒数：" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20"/>
                        <Label  Content="当前合格数：" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20"/>
                        <Label  Content="当前不合格数：" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20"/>
                    </StackPanel>
                    <StackPanel Orientation="Vertical">
                        <TextBox x:Name="AllActiveNumTbx" Text="{Binding AllActiveNum}" HorizontalAlignment="Left" Margin="0,15,0,0"  TextWrapping="Wrap" Width="120" FontWeight="Bold" FontSize="20" IsReadOnly="True" Background="{x:Null}"/>
                        <TextBox x:Name="AllOkNumTbx" Text="{Binding AllOkNum}" HorizontalAlignment="Left" Margin="0,17,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="120" FontWeight="Bold" FontSize="20" IsReadOnly="True" Background="{x:Null}"/>
                        <TextBox x:Name="AllNgNumTbx" Text="{Binding AllNgNum}" HorizontalAlignment="Left" Margin="0,17,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="120" FontWeight="Bold" FontSize="20" IsReadOnly="True" Background="{x:Null}"/>
                    </StackPanel>
                    <StackPanel Orientation="Vertical">
                        <Label x:Name="CamRunStaticLab" Content="{Binding CamRunStatic}" HorizontalAlignment="Right" Margin="10,5,10,0" VerticalAlignment="Top" Background="{x:Null}" FontSize="25" Foreground="{Binding CameraStaticColor}" FontWeight="Bold" />
                        <Button x:Name="DataClear" Content="清零" BorderThickness="1" HorizontalAlignment="Left" Margin="10,50,10,0" VerticalAlignment="Top" Width="80" Height="40" Background="#B20123FF" FontWeight="Bold" FontSize="20" Foreground="White" Click="DataClear_Click" Cursor="Hand">
                            <Button.Template>
                                <ControlTemplate TargetType="Button">
                                    <Border CornerRadius="5" 
                                            Background="{TemplateBinding Background}"
                                            BorderBrush="{TemplateBinding BorderBrush}"
                                            BorderThickness="{TemplateBinding BorderThickness}">
                                        <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Border>
                                </ControlTemplate>
                            </Button.Template>
                        </Button>
                    </StackPanel>
                </StackPanel>
                <!-- 卡片内容 -->
            </Border>

            <Border Grid.Column="1" 
                    Background="#B20092FF" 
                    CornerRadius="8"
                    BorderBrush="Gray"
                    BorderThickness="1"
                    Margin="15,10,15,0" Height="60" VerticalAlignment="Top">
                <StackPanel Orientation="Horizontal">
                    <StackPanel Orientation="Vertical">
                        <Label  Content="计数速度：" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" FontWeight="Bold" FontSize="20"/>
                    </StackPanel>
                    <StackPanel Orientation="Vertical" Margin="40,0,0,0" >
                        <TextBox x:Name="ShuLiSpeedTbx" Text="{Binding ShuLiSpeed}" HorizontalAlignment="Left" Margin="0,15,0,0"  TextWrapping="Wrap" Width="120" FontWeight="Bold" FontSize="20" IsReadOnly="True" Background="{x:Null}"/>
                    </StackPanel>
                    <StackPanel Orientation="Vertical" Margin="10,0,0,0" >
                        <Label Content="粒/秒" FontWeight="Bold" FontSize="20" Margin="0,10,0,0" />
                    </StackPanel>
                </StackPanel>
            </Border>
        </Grid>
        
    </Grid>
</Page>
