<UserControl x:Class="MainShell.ToolBox.View.VisionDisplayTestView"
             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:mw="http://www.maxwell-gp.com/"
             mc:Ignorable="d"
             d:DesignHeight="450"
             d:DesignWidth="800">
    <Grid Margin="12">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Border Padding="12" BorderBrush="#C7C7C7" BorderThickness="1" Background="#F8FAFC">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="180"/>
                    <ColumnDefinition Width="24"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>

                <TextBlock VerticalAlignment="Center" Text="目标相机:" FontWeight="SemiBold"/>
                <ComboBox Grid.Column="1"
                          Margin="8,0,0,0"
                          ItemsSource="{Binding CameraTypes}"
                          SelectedItem="{Binding State.SelectedCameraType}"
                          VerticalAlignment="Center"/>

                <CheckBox Grid.Column="3"
                          VerticalAlignment="Center"
                          IsChecked="{Binding State.ClearShapesBeforeDisplay}"
                          Content="显示前清空图形"/>
            </Grid>
        </Border>

        <StackPanel Grid.Row="1" Margin="0,12,0,0" Orientation="Horizontal">
            <Button MinWidth="120"
                    Height="32"
                    Margin="0,0,12,0"
                    Content="发送图片事件"
                    mw:View.ActionTarget="{Binding}"
                    Click="{mw:Action SendImageEvent}"/>
            <Button MinWidth="140"
                    Height="32"
                    Margin="0,0,12,0"
                    Content="发送显示事件"
                    mw:View.ActionTarget="{Binding}"
                    Click="{mw:Action SendDisplayEvent}"/>
            <Button MinWidth="120"
                    Height="32"
                    Content="清空显示"
                    mw:View.ActionTarget="{Binding}"
                    Click="{mw:Action ClearDisplayEvent}"/>
        </StackPanel>

        <Border Grid.Row="2" Margin="0,12,0,0" Padding="12" BorderBrush="#C7C7C7" BorderThickness="1" Background="#FFFFFF">
            <StackPanel>
                <TextBlock Text="测试说明" FontSize="16" FontWeight="Bold" Foreground="#0B4A8B"/>
                <TextBlock Margin="0,10,0,0" TextWrapping="Wrap" Text="1. 发送图片事件后，主界面对应相机区域应显示一张 320x240 的模拟彩色图。"/>
                <TextBlock Margin="0,6,0,0" TextWrapping="Wrap" Text="2. 发送显示事件后，主界面对应相机区域应叠加点、文本、矩形、圆和线。"/>
                <TextBlock Margin="0,6,0,0" TextWrapping="Wrap" Text="3. 清空显示用于验证 Shapes 清理是否生效。"/>
                <Border Margin="0,16,0,0" Padding="10" Background="#EFF6FF" BorderBrush="#BFDBFE" BorderThickness="1">
                    <TextBlock TextWrapping="Wrap" Text="{Binding State.StatusMessage}" Foreground="#1D4ED8"/>
                </Border>
            </StackPanel>
        </Border>
    </Grid>
</UserControl>
