NS_KetRight.xaml 5.4 KB
<UserControl x:Class="SmartScan.SetControl.WPF.NS_KetRight"
             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:SmartScan.SetControl.WPF"
             mc:Ignorable="d" MinHeight="400" Height="Auto"
              Background="#121212">
    <UserControl.Resources>
        <Style TargetType="{x:Type TextBlock}">
            <Setter Property="Foreground" Value="#E6E6E6"/>
            <Setter Property="FontFamily" Value="Microsoft YaHei"/>
        </Style>
        <Style TargetType="{x:Type Label}">
            <Setter Property="Foreground" Value="#E6E6E6"/>
            <Setter Property="FontFamily" Value="Microsoft YaHei"/>
        </Style>
        <Style TargetType="{x:Type TextBox}">
            <Setter Property="Background" Value="#252525"/>
            <Setter Property="Foreground" Value="#E6E6E6"/>
            <Setter Property="BorderBrush" Value="#3F3F3F"/>
            <Setter Property="FontFamily" Value="Microsoft YaHei"/>
        </Style>
        <Style TargetType="{x:Type Button}">
            <Setter Property="Background" Value="#0078D7"/>
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="FontFamily" Value="Microsoft YaHei"/>
            <Setter Property="Padding" Value="10,5"/>
        </Style>
    </UserControl.Resources>
    <Grid>
        <!-- 内容区域 -->
        <StackPanel>
            <!-- 标题栏保持不变 -->
            <Border Background="#0078D7" Height="40">
                <TextBlock Text="元件信息" 
                  Name="Wpf_right_name"
                  HorizontalAlignment="Center" 
                  VerticalAlignment="Center" 
                  Foreground="White" 
                  FontSize="14" FontFamily="微软雅黑"
                  FontWeight="Bold"/>
            </Border>

            <!-- 字段区域添加单独的滚动条,并限制最大高度 -->
            <ScrollViewer VerticalScrollBarVisibility="Auto" MaxHeight="450">
                <StackPanel x:Name="FieldsPanel" Margin="10,10,10,0">
                    <!-- 动态生成的字段会被添加到这里 -->
                </StackPanel>
            </ScrollViewer>

            <!-- 按钮和识别结果区域保持在滚动区域外,确保始终可见 -->
            <StackPanel Margin="10,0,10,10">
                <!-- 操作按钮区域 -->
                <StackPanel Name="ButtonsPanel" Margin="0,10,0,10">
                    <!-- 按钮会被添加到这里 -->
                </StackPanel>

                <!-- 识别结果区域 -->
                <StackPanel Name="ResultPanel" Margin="0,10,0,0" Background="{x:Null}">
                    <Border Background="{x:Null}" CornerRadius="3">
                        <StackPanel>
                            <StackPanel x:Name="ResultItemsPanel">
                                <!-- 识别结果项目会被动态添加到这里 -->
                            </StackPanel>
                        </StackPanel>
                    </Border>
                </StackPanel>

                <!-- 分割线 -->
                <Separator Background="#3F3F3F" Height="1" Margin="0,5,0,15"/>

                <!-- 图例说明 -->
                <StackPanel>
                    <Grid Margin="0,5,0,5">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="24"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Rectangle Width="16" Height="16" Fill="#4CAF50" RadiusX="2" RadiusY="2"/>
                        <TextBlock Grid.Column="1" x:Name="lbl_Green" Text="绿色 - 完全正确" FontSize="14" FontFamily="微软雅黑" VerticalAlignment="Center" Margin="10,0,0,0"/>
                    </Grid>

                    <Grid Margin="0,5,0,5">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="24"/>
                            <ColumnDefinition Width="3*"/>
                            <ColumnDefinition Width="13*"/>
                        </Grid.ColumnDefinitions>
                        <Rectangle Width="16" Height="16" Fill="#FFC107" RadiusX="2" RadiusY="2" Margin="4,1,4,1"/>
                        <TextBlock Grid.Column="1" x:Name="lbl_yellow" Text="黄色 - OCR识别结果,需要验证" FontSize="14" FontFamily="微软雅黑" VerticalAlignment="Center" Margin="10,0,0,0" Grid.ColumnSpan="2"/>
                    </Grid>

                    <Grid Margin="0,5,0,5">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="24"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Rectangle Width="16" Height="16" Fill="#F44336" RadiusX="2" RadiusY="2"/>
                        <TextBlock Grid.Column="1" x:Name="lbl_red" Text="红色 - 无法识别或有问题" FontSize="14" FontFamily="微软雅黑" VerticalAlignment="Center" Margin="10,0,0,0"/>
                    </Grid>
                </StackPanel>
            </StackPanel>
        </StackPanel>

    </Grid>
</UserControl>