<Window x:Class="MeterVision.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:MeterVision"
        xmlns:WPF.UI="clr-namespace:ZdfFlatUI;assembly=WPF.UI"
        xmlns:util="clr-namespace:MeterVision.Util"
        mc:Ignorable="d" Icon="Assest/meterVision2.png"
        WindowState="Maximized"
        AllowDrop="False"
        PreviewMouseDown="Window_PreviewMouseDown"
        PreviewKeyDown="Window_PreviewKeyDown"
        Title="读表器AI模型测试验证工具-需配置版" Height="768" Width="1366">
    <Window.Resources>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="30" />
            <RowDefinition Height="*" />
            <RowDefinition Height="25" />
        </Grid.RowDefinitions>
        
        <!--上方的工具栏-->
        <Border Grid.Row="0" Background="#EDF0F3" BorderThickness="0 0 0 1" BorderBrush="#ACAAAA">
            <WrapPanel Orientation="Horizontal">
                <Button x:Name="btnConfig" Click="BtnConfig_Click" Background="Transparent" Margin="5 0 5 0" BorderBrush="Transparent" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <Button.Content>
                        <StackPanel Orientation="Horizontal">
                            <!-- 图标 -->
                            <Image Source="Assest/config2.png" Width="16" Height="16" Margin="0,0,5,0" />
                            <!-- 文字 -->
                            <TextBlock x:Name="txtConfig" Text="基本设置" FontSize="14" Foreground="Black" VerticalAlignment="Center" />
                        </StackPanel>
                    </Button.Content>
                </Button>

                <TextBlock Width="1" Background="#686868" Margin="5 5 5 5" Visibility="Visible" />

                <Button x:Name="btnSetStation" Visibility="Collapsed" BorderThickness="0" Click="BtnSetStation_Click" Background="Transparent" Margin="5 0 5 0" BorderBrush="Transparent" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <Button.Content>
                        <StackPanel Orientation="Horizontal">
                             <!--图标--> 
                            <Image Source="Assest/set_station.png" Width="16" Height="16" Margin="0,0,5,0" />
                             <!--文字--> 
                            <TextBlock x:Name="txtSetStation" FontSize="14" FontWeight="Normal" Text="站点设置" Foreground="Black" VerticalAlignment="Center" />
                        </StackPanel>
                    </Button.Content>
                </Button>

                <TextBlock Width="1" Background="#686868" Margin="5 5 5 5" Visibility="Collapsed" />

                <Button x:Name="btnSingleImage" BorderThickness="0" Click="BtnSingleImage_Click" Background="Transparent" Margin="5 0 5 0" BorderBrush="Transparent" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <Button.Content>
                        <StackPanel Orientation="Horizontal">
                            <!-- 图标 -->
                            <Image Source="Assest/single_2.png" Width="16" Height="16" Margin="0,0,5,0" />
                            <!-- 文字 -->
                            <TextBlock x:Name="txtSingleImage" FontSize="14" FontWeight="Normal" Text="单图识别" Foreground="Black" VerticalAlignment="Center" />
                        </StackPanel>
                    </Button.Content>
                </Button>

                <TextBlock Width="1" Background="#686868" Margin="5 5 5 5" Visibility="Visible" />
                <Button x:Name="btnStandImport" Click="BtnStandImport_Click" Background="Transparent" Margin="5 0 5 0" BorderBrush="Transparent" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <Button.Content>
                        <StackPanel Orientation="Horizontal">
                            <!-- 图标 -->
                            <Image Source="Assest/stand_import2.png" Width="15" Height="15" Margin="0,0,5,0" />
                            <!-- 文字 -->
                            <TextBlock x:Name="txtStandImport" FontSize="14" Text="模板维护" Foreground="Black" VerticalAlignment="Center" />
                        </StackPanel>
                    </Button.Content>
                </Button>
               
                <TextBlock Width="1" Background="#686868" Margin="5 5 5 5" Visibility="Visible" />

                <Button x:Name="btnPatchImage" Click="BtnPatchImage_Click" Background="Transparent" Margin="5 0 5 0" BorderBrush="Transparent" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <Button.Content>
                        <StackPanel Orientation="Horizontal">
                            <!-- 图标 -->
                            <Image Source="Assest/patch2.png" Width="16" Height="16" Margin="0,0,5,0" />
                            <!-- 文字 -->
                            <TextBlock x:Name="txtPatchImage" FontSize="14" Text="批量识别" Foreground="Black" VerticalAlignment="Center" />
                        </StackPanel>
                    </Button.Content>
                </Button>

                <TextBlock Width="1" Background="#686868" Margin="5 5 5 5" Visibility="Visible" />

                <Button x:Name="btnPatchCompare" Click="BtnPatchCompare_Click" Background="Transparent" Margin="5 0 5 0" BorderBrush="Transparent" HorizontalAlignment="Center" VerticalAlignment="Center">
                    <Button.Content>
                        <StackPanel Orientation="Horizontal">
                            <!-- 图标 -->
                            <Image Source="Assest/patch_compare2.png" Width="16" Height="16" Margin="0,0,5,0" />
                            <!-- 文字 -->
                            <TextBlock x:Name="txtCompareImage" FontSize="14" Text="识别比较" Foreground="Black" VerticalAlignment="Center" />
                        </StackPanel>
                    </Button.Content>
                </Button>
                
                <TextBlock Width="1" Background="#686868" Margin="5 5 5 5" Visibility="Visible" />

                <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" Margin="0 0 0 0">
                    <!--<TextBlock Width="1" Background="#686868" Margin="50 5 5 5" Visibility="Visible" />-->
                    <Button x:Name="btnCheckUpgrade" Click="BtnCheckUpgrade_Click" Background="Transparent"
                        Margin="5 0 5 0" BorderBrush="Transparent" HorizontalAlignment="Right" VerticalAlignment="Center">
                        <Button.Content>
                            <StackPanel Orientation="Horizontal">
                                <!-- 图标 -->
                                <Image Source="Assest/update_3.png" Width="17" Height="17" Margin="0,0,4,0" />
                                <!-- 文字 -->
                                <TextBlock  FontSize="14" Text="检查更新" Foreground="Black" VerticalAlignment="Center" />
                            </StackPanel>
                        </Button.Content>
                    </Button>
                </StackPanel>

                <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
                    <TextBlock Width="1" Background="#686868" Margin="5 5 5 5" Visibility="Visible" />
                    <Button x:Name="btnReg" Click="BtnReg_Click" Background="Transparent"
                        Margin="5 0 5 0" BorderBrush="Transparent" HorizontalAlignment="Right" VerticalAlignment="Center">
                        <Button.Content>
                            <StackPanel Orientation="Horizontal">
                                <!-- 图标 -->
                                <Image Source="Assest/license.png" Width="16" Height="16" Margin="0,0,5,0" />
                                <!-- 文字 -->
                                <TextBlock  FontSize="14" Text="注册" Foreground="Black" VerticalAlignment="Center" />
                            </StackPanel>
                        </Button.Content>
                    </Button>
                </StackPanel>

                <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
                    <TextBlock Width="1" Background="#686868" Margin="5 5 5 5" Visibility="Visible" />
                    <Button x:Name="btnAbout" Click="BtnAbout_Click" Background="Transparent"
                        Margin="5 0 5 0" BorderBrush="Transparent" HorizontalAlignment="Right" VerticalAlignment="Center">
                        <Button.Content>
                            <StackPanel Orientation="Horizontal">
                                <!-- 图标 -->
                                <Image Source="Assest/about_me2.png" Width="16" Height="16" Margin="0,0,5,0" />
                                <!-- 文字 -->
                                <TextBlock  FontSize="14" Text="关于" Foreground="Black" VerticalAlignment="Center" />
                            </StackPanel>
                        </Button.Content>
                    </Button>
                </StackPanel>

                <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch">
                    <TextBlock Width="1" Background="#686868" Margin="5 5 5 5" Visibility="Visible" />
                    <Button x:Name="btnFreeSpace" Click="BtnFreeSpace_Click" Background="Transparent"
                        Margin="5 0 5 0" BorderBrush="Transparent" HorizontalAlignment="Right" VerticalAlignment="Center">
                        <Button.Content>
                            <StackPanel Orientation="Horizontal">
                                <!-- 图标 -->
                                <Image Source="Assest/free_space.png" Width="16" Height="16" Margin="0,0,5,0" />
                                <!-- 文字 -->
                                <TextBlock  FontSize="14" Text="释放数据库占用" Foreground="Black" VerticalAlignment="Center" />
                            </StackPanel>
                        </Button.Content>
                    </Button>
                </StackPanel>

                <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                    <TextBlock Width="1" Background="#686868" Margin="5 5 5 5" Visibility="Visible" />
                    <CheckBox x:Name="chkRealRecordAILog" Content="实时记录AI日志" FontSize="14px"
                              VerticalAlignment="Center" 
                              Unchecked="ChkRealRecordAILog_Unchecked"
                              Checked="ChkRealRecordAILog_Checked"/>
                    <!-- "#5A89FF"图标用的蓝色 -->
                    <Button x:Name="btnViewRealLog" Content="查看" Background="Transparent" BorderThickness="0"
                            Click="BtnViewRealLog_Click"
                               Foreground="Blue" FontSize="14px" VerticalAlignment="Center" Margin="5 0 0 0" />
                </StackPanel>

                <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
                    <TextBlock Width="1" Background="#686868" Margin="5 5 5 5" Visibility="Visible" />
                    <CheckBox x:Name="chkRealSendAILog" Content="UDP实时发送AI日志" FontSize="14px"
                              VerticalAlignment="Center" 
                              Unchecked="ChkRealSendAILog_Unchecked"
                              Checked="ChkRealSendAILog_Checked"/>
                </StackPanel>

                <StackPanel Orientation="Horizontal" VerticalAlignment="Center" Visibility="Collapsed">
                    <TextBlock Width="1" Background="#686868" Margin="5 5 5 5" Visibility="Visible" />
                    <Button x:Name="btnUpdateJson" Content="临时修改Json文件" Click="BtnUpdateJson_Click" />
                </StackPanel>

            </WrapPanel>
        </Border>

         <!--中间的容器部分-->
        <Border Grid.Row="1">
            <ContentControl x:Name="ContentArea" />
        </Border>

        <!--状态栏部分-->
        <Border Grid.Row="2" Background="#F0F0F0" BorderThickness="0 1 0 0" BorderBrush="#ACAAAA">
            <StackPanel Orientation="Horizontal">
                <Label x:Name="lblInstanceIndex" Content="第一个"  Margin="0 0 10 0" Padding="5 0 5 0"
                       Background="Green" Foreground="White"  FontSize="14"
                       VerticalContentAlignment="Center" HorizontalContentAlignment="Center"  />
                <StackPanel Orientation="Horizontal" Margin="5 0 5 0" VerticalAlignment="Center">
                    <!--<TextBlock Text="永久有效" FontSize="14" Background="Transparent" Foreground="Green" Margin="0 0 10 0"/>-->
                    <TextBlock Text="ONNX模型名称:" FontSize="14" Background="Transparent" Margin="0 0 10 0"/>
                    <TextBlock Text="{Binding CurConfigItem.OnnxPath}" FontSize="14" Background="Transparent" />

                    <TextBlock Text="AI动态库名称:" FontSize="14" Background="Transparent" Margin="20 0 10 0"/>
                    <TextBlock Text="{Binding CurConfigItem.AiDll}" FontSize="14" Background="Transparent" />
                </StackPanel>
            </StackPanel>
        </Border>

        <!-- 覆盖层，位于所有其他内容之上 --><!--
        <Border x:Name="overlay" Visibility="Collapsed" Background="Transparent" 
                PreviewMouseLeftButtonDown="Overlay_PreviewMouseLeftButtonDown"/>-->
        
    </Grid>
</Window>
