<UserControl x:Class="MeterVision.Single.RowItemSingle"
             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:MeterVision.Single"
             mc:Ignorable="d" 
             Background="White"
             BorderThickness="0 0 0 1"
             BorderBrush="#E0E0E0"
             d:DesignHeight="50" d:DesignWidth="900">

    <UserControl.Resources>
        <Style x:Key="MyGridStyle" TargetType="{x:Type Grid}" >
            <Setter Property="Background" Value="#fbfbfb" />
            <Style.Triggers>
                <!--WPF这个触发器挺好用，可以减少代码冗余，尝试多用-->
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="#E0E5F2"></Setter>
                </Trigger>
                <Trigger Property="IsMouseOver" Value="False">
                    <Setter Property="Background" Value="#FFFFFF"></Setter>
                </Trigger>
            </Style.Triggers>
        </Style>

        <Style x:Key="myWdyyStyle1" TargetType="{x:Type TextBox}">
            <Setter Property="Background" Value="#fbfbfb" />
            <Style.Triggers>
                <!--WPF这个触发器挺好用，可以减少代码冗余，尝试多用-->
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="#E0E5F2"></Setter>
                </Trigger>
                <Trigger Property="IsMouseOver" Value="False">
                    <Setter Property="Background" Value="#FFFFFF"></Setter>
                </Trigger>
            </Style.Triggers>
        </Style>

        <Style x:Key="myWdyyStyle2" TargetType="{x:Type ComboBox}">
            <Setter Property="Background" Value="#fbfbfb" />
            <Style.Triggers>
                <!--WPF这个触发器挺好用，可以减少代码冗余，尝试多用-->
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="#E0E5F2"></Setter>
                </Trigger>
                <Trigger Property="IsMouseOver" Value="False">
                    <Setter Property="Background" Value="#FFFFFF"></Setter>
                </Trigger>
            </Style.Triggers>
        </Style>

        <PathGeometry x:Key="ok" Figures="M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z" />

    </UserControl.Resources>

    <Grid Height="50" Width="Auto" Style="{StaticResource MyGridStyle}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="40" />
            <ColumnDefinition Width="65" />
            <ColumnDefinition Width="80" />
            <ColumnDefinition Width="0" />
            <ColumnDefinition Width="65" />
            <ColumnDefinition Width="100" />
            <ColumnDefinition Width="120" />
            <ColumnDefinition Width="250" />
            <ColumnDefinition Width="50" />
            <ColumnDefinition Width="50" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <Border Grid.Column="0" Margin="0" Padding="2 2 0 2" BorderBrush="#E0E0E0" BorderThickness="0 0 1 0">
            <TextBlock x:Name="txtIndex" Text="18" FontSize="13px" Foreground="#333333" HorizontalAlignment="Left" VerticalAlignment="Center" />
        </Border>

        <Border Grid.Column="1" Margin="0" Padding="2"  BorderBrush="#E0E0E0" BorderThickness="0 0 1 0">
            <Image x:Name="imgSource" Source="C:\\test_image\\result\\20240913_193856.jpg" VerticalAlignment="Center" HorizontalAlignment="Center" />
        </Border>

        <Border Grid.Column="2" Margin="0" Padding="0" BorderBrush="#E0E0E0" BorderThickness="0 0 1 0" >
            <StackPanel Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center">
                <TextBlock x:Name="txtTestDate" FontSize="13px" Text="10:25:56" Foreground="#333333" HorizontalAlignment="Center" />
                <TextBlock x:Name="txtTestTime" FontSize="12px" Text="2024-10-19" Foreground="#333333" />
            </StackPanel>
        </Border>

        <!--暂不显示-->
        <Border Grid.Column="3" Padding="2 2 0 2" BorderBrush="#E0E0E0" BorderThickness="0 0 1 0">
            <TextBlock x:Name="txtManualConfig" FontSize="12px" Foreground="#000000" VerticalAlignment="Center" >
                <Run Text="数字个数:7"/>
                    <LineBreak/>
                <Run Text="指针个数:3"/>
            </TextBlock>
        </Border>

        <Border Grid.Column="4" Margin="0" Padding="2"  BorderBrush="#E0E0E0" BorderThickness="0 0 1 0">
            <Image x:Name="imgResult" Source="C:\\test_image\\result\\20240913_193856.jpg" VerticalAlignment="Center" HorizontalAlignment="Center" />
        </Border>

        <Border Grid.Column="5" Margin="0" Padding="5 2 0 2" BorderBrush="#E0E0E0" BorderThickness="0 0 1 0" >
            <StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
                <TextBlock x:Name="txtWmType" FontSize="12px" Text="数字水表" Foreground="#333333"/>
                <TextBlock x:Name="txtCount" FontSize="12px" Text="数字:5 指针:3" Foreground="#333333" />
                <TextBlock x:Name="txtLastUnit" FontSize="12px" Text="尾数:0.001m³" Foreground="#333333" />
            </StackPanel>
        </Border>

        <Border Grid.Column="6" Margin="0" Padding="5 2 0 2" BorderBrush="#E0E0E0" BorderThickness="0 0 1 0">
            <StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Left">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left">
                    <Grid Width="12" Height="12" HorizontalAlignment="Center" VerticalAlignment="Center">
                        <!-- Ellipse: 圆形 -->
                        <Ellipse x:Name="circle" HorizontalAlignment="Center" VerticalAlignment="Center" Width="12" Height="12">
                            <Ellipse.Fill>
                                <SolidColorBrush Color="DarkGreen"/>
                            </Ellipse.Fill>
                        </Ellipse>
                        <!-- TextBlock: 显示文本 -->
                        <TextBlock x:Name="circleText" Text="8" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="10px" Foreground="White" />
                    </Grid>
                    <TextBlock Text="结果：" FontSize="13px" Foreground="#666666" Padding="2 0 0 0"/>
                    <TextBlock Text="2473.123" FontSize="13px" Foreground="#333333" />
                </StackPanel>
                <StackPanel Orientation="Horizontal">
                    <TextBlock Width="12" />
                    <TextBlock Text="原始：" FontSize="13px" Foreground="#666666" Padding="2 0 0 0" />
                    <TextBlock Text="2473.123" FontSize="13px" Foreground="#333333" />
                </StackPanel>
            </StackPanel>
        </Border>

        <Border Grid.Column="7" Margin="0" Padding="2" BorderBrush="#E0E0E0" BorderThickness="0 0 1 0" >
            <Border BorderBrush="#E0E0E0" BorderThickness="1" >
                <Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*" />
                        <RowDefinition Height="*" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <!-- 单元格 1 -->
                    <Border Grid.Row="0" Grid.Column="0" BorderBrush="#E0E0E0" BorderThickness="0 0 1 0" Padding="0">
                        <TextBlock Foreground="#666666" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="1" />
                    </Border>

                    <!-- 单元格 2 -->
                    <Border Grid.Row="0" Grid.Column="1" BorderBrush="#E0E0E0" BorderThickness="0 0 1 0" Padding="0">
                        <TextBlock Foreground="#666666" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="2" />
                    </Border>

                    <!-- 单元格 3 -->
                    <Border Grid.Row="0" Grid.Column="2" BorderBrush="#E0E0E0" BorderThickness="0 0 1 0" Padding="0">
                        <TextBlock Foreground="#666666" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="3" />
                    </Border>

                    <!-- 单元格 4 -->
                    <Border Grid.Row="0" Grid.Column="3" BorderBrush="#E0E0E0" BorderThickness="0 0 1 0" Padding="0">
                        <TextBlock Foreground="#666666" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="4" />
                    </Border>

                    <!-- 单元格 5 -->
                    <Border Grid.Row="0" Grid.Column="4" BorderBrush="#E0E0E0" BorderThickness="0 0 1 0" Padding="0">
                        <TextBlock Foreground="#666666" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="5" />
                    </Border>

                    <!-- 单元格 6 -->
                    <Border Grid.Row="0" Grid.Column="5" BorderBrush="#E0E0E0" BorderThickness="0 0 1 0" Padding="0">
                        <TextBlock Foreground="#666666" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="6" />
                    </Border>

                    <!-- 单元格 7 -->
                    <Border Grid.Row="0" Grid.Column="6" BorderBrush="#E0E0E0" BorderThickness="0 0 1 0" Padding="0">
                        <TextBlock Foreground="#666666" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="7" />
                    </Border>

                    <!-- 单元格 8 -->
                    <Border Grid.Row="0" Grid.Column="7" BorderBrush="#E0E0E0" BorderThickness="0 0 1 0" Padding="0">
                        <TextBlock Foreground="#666666" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="8" />
                    </Border>

                    <!-- 单元格 9 -->
                    <Border Grid.Row="0" Grid.Column="8" BorderBrush="#E0E0E0" BorderThickness="0 0 1 0" Padding="0">
                        <TextBlock Foreground="#666666" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="9" />
                    </Border>

                    <!-- 单元格 10 -->
                    <Border Grid.Row="0" Grid.Column="9" BorderBrush="#E0E0E0" BorderThickness="0 0 1 0" Padding="0">
                        <TextBlock Foreground="#666666" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="10" />
                    </Border>

                    <!-- 单元格 11 -->
                    <Border Grid.Row="0" Grid.Column="10" BorderBrush="#E0E0E0" BorderThickness="0 0 1 0" Padding="0">
                        <TextBlock Foreground="#666666" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="11" />
                    </Border>

                    <Border Grid.Row="0" Grid.Column="11" BorderBrush="#E0E0E0" BorderThickness="0 0 0 0" Padding="0">
                        <TextBlock Foreground="#666666" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="12" />
                    </Border>

                    <!-- 单元格 1 -->
                    <Border Grid.Row="1" Grid.Column="0" BorderBrush="#E0E0E0" BorderThickness="0 1 1 0" Padding="0">
                        <TextBlock Foreground="#333333" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="20" />
                    </Border>

                    <!-- 单元格 2 -->
                    <Border Grid.Row="1" Grid.Column="1" BorderBrush="#E0E0E0" BorderThickness="0 1 1 0" Padding="0">
                        <TextBlock Foreground="#333333" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="20" />
                    </Border>

                    <!-- 单元格 3 -->
                    <Border Grid.Row="1" Grid.Column="2" BorderBrush="#E0E0E0" BorderThickness="0 1 1 0" Padding="0">
                        <TextBlock Foreground="#333333" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="20" />
                    </Border>

                    <!-- 单元格 4 -->
                    <Border Grid.Row="1" Grid.Column="3" BorderBrush="#E0E0E0" BorderThickness="0 1 1 0" Padding="0">
                        <TextBlock Foreground="#333333" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="24" />
                    </Border>

                    <!-- 单元格 5 -->
                    <Border Grid.Row="1" Grid.Column="4" BorderBrush="#E0E0E0" BorderThickness="0 1 1 0" Padding="0">
                        <TextBlock Foreground="#333333" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="7" />
                    </Border>

                    <!-- 单元格 6 -->
                    <Border Grid.Row="1" Grid.Column="5" BorderBrush="#E0E0E0" BorderThickness="0 1 1 0" Padding="0">
                        <TextBlock Foreground="#333333" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="" />
                    </Border>

                    <!-- 单元格 7 -->
                    <Border Grid.Row="1" Grid.Column="6" BorderBrush="#E0E0E0" BorderThickness="0 1 1 0" Padding="0">
                        <TextBlock Foreground="#333333" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="" />
                    </Border>

                    <!-- 单元格 8 -->
                    <Border Grid.Row="1" Grid.Column="7" BorderBrush="#E0E0E0" BorderThickness="0 1 1 0" Padding="0">
                        <TextBlock Foreground="#333333" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="" />
                    </Border>

                    <!-- 单元格 9 -->
                    <Border Grid.Row="1" Grid.Column="8" BorderBrush="#E0E0E0" BorderThickness="0 1 1 0" Padding="0">
                        <TextBlock Foreground="#333333" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="6" />
                    </Border>

                    <!-- 单元格 10 -->
                    <Border Grid.Row="1" Grid.Column="9" BorderBrush="#E0E0E0" BorderThickness="0 1 1 0" Padding="0">
                        <TextBlock Foreground="#333333" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="0" />
                    </Border>

                    <!-- 单元格 11 -->
                    <Border Grid.Row="1" Grid.Column="10" BorderBrush="#E0E0E0" BorderThickness="0 1 1 0" Padding="0">
                        <TextBlock Foreground="#333333" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="119" />
                    </Border>
                    <!-- 单元格 12 -->
                    <Border Grid.Row="1" Grid.Column="11" BorderBrush="#E0E0E0" BorderThickness="0 1 0 0" Padding="0">
                        <TextBlock Foreground="#333333" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="7" />
                    </Border>

                    <!-- 单元格 1 -->
                    <Border Grid.Row="2" Grid.Column="0" BorderBrush="#E0E0E0" BorderThickness="0 1 1 0" Padding="0">
                        <TextBlock Foreground="#333333" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="62" />
                    </Border>

                    <!-- 单元格 2 -->
                    <Border Grid.Row="2" Grid.Column="1" BorderBrush="#E0E0E0" BorderThickness="0 1 1 0" Padding="0">
                        <TextBlock Foreground="#333333" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="99" />
                    </Border>

                    <!-- 单元格 3 -->
                    <Border Grid.Row="2" Grid.Column="2" BorderBrush="#E0E0E0" BorderThickness="0 1 1 0" Padding="0">
                        <TextBlock Foreground="#333333" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="99" />
                    </Border>

                    <!-- 单元格 4 -->
                    <Border Grid.Row="2" Grid.Column="3" BorderBrush="#E0E0E0" BorderThickness="0 1 1 0" Padding="0">
                        <TextBlock Foreground="#333333" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="72" />
                    </Border>

                    <!-- 单元格 5 -->
                    <Border Grid.Row="2" Grid.Column="4" BorderBrush="#E0E0E0" BorderThickness="0 1 1 0" Padding="0">
                        <TextBlock Foreground="#333333" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="75" />
                    </Border>

                    <!-- 单元格 6 -->
                    <Border Grid.Row="2" Grid.Column="5" BorderBrush="#E0E0E0" BorderThickness="0 1 1 0" Padding="0">
                        <TextBlock Foreground="#333333" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="" />
                    </Border>

                    <!-- 单元格 7 -->
                    <Border Grid.Row="2" Grid.Column="6" BorderBrush="#E0E0E0" BorderThickness="0 1 1 0" Padding="0">
                        <TextBlock Foreground="#333333" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="" />
                    </Border>

                    <!-- 单元格 8 -->
                    <Border Grid.Row="2" Grid.Column="7" BorderBrush="#E0E0E0" BorderThickness="0 1 1 0" Padding="0">
                        <TextBlock Foreground="#333333" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="" />
                    </Border>

                    <!-- 单元格 9 -->
                    <Border Grid.Row="2" Grid.Column="8" BorderBrush="#E0E0E0" BorderThickness="0 1 1 0" Padding="0">
                        <TextBlock Foreground="#333333" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="6" />
                    </Border>

                    <!-- 单元格 10 -->
                    <Border Grid.Row="2" Grid.Column="9" BorderBrush="#E0E0E0" BorderThickness="0 1 1 0" Padding="0">
                        <TextBlock Foreground="#333333" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="0" />
                    </Border>

                    <!-- 单元格 11 -->
                    <Border Grid.Row="2" Grid.Column="10" BorderBrush="#E0E0E0" BorderThickness="0 1 1 0" Padding="0">
                        <TextBlock Foreground="#333333" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="1" />
                    </Border>
                    <!-- 单元格 12 -->
                    <Border Grid.Row="2" Grid.Column="11" BorderBrush="#E0E0E0" BorderThickness="0 1 0 0" Padding="0">
                        <TextBlock Foreground="#333333" FontSize="11" HorizontalAlignment="Center" VerticalAlignment="Center" Text="62" />
                    </Border>

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


        <Border Grid.Column="8" Margin="0" Padding="0" BorderBrush="#E0E0E0" BorderThickness="0 0 1 0" >
            <Button x:Name="btnViewLog" Width="Auto" FontSize="13px" Content="日志" Foreground="DodgerBlue" VerticalAlignment="Center"
                    BorderBrush="DodgerBlue" BorderThickness="0 0 0 0" Background="Transparent" />
        </Border>

        <Border Grid.Column="9" Margin="0" Padding="5 2 0 2" BorderBrush="#E0E0E0" BorderThickness="0 0 0 0" VerticalAlignment="Center" >
            <Button x:Name="btnDelete" Width="Auto" FontSize="13px" Content="删除" Foreground="DodgerBlue" BorderBrush="DodgerBlue" BorderThickness="0 0 0 0" Background="Transparent" />
        </Border>


    </Grid>
</UserControl>
