WPF_Date_From.xaml 38.6 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702
<UserControl x:Class="SmartScan.SetControl.WPF.WPF_Date_From"
             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" 
             xmlns:local1="clr-namespace:SmartScan.SetControl.WPF.Convent" xmlns:wfh="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             mc:Ignorable="d" 
             d:DesignHeight="650" d:DesignWidth="800" Background="#FF111111"   BorderBrush="#FF0066CC" Loaded="UserControl_Loaded">
    <UserControl.Resources>
        <!-- 需要添加的转换器 -->
        <BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
        <local1:WidthMinusMarginConverter x:Key="WidthMinusMarginConverter"/>
        <local1:BoolToColorConverter1 x:Key="BoolToColorConverter"/>
        <!-- 通用样式 -->
        <Style x:Key="BlueButton" TargetType="Button">
            <Setter Property="Background" Value="#0078D7"/>
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="Height" Value="40"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border Background="{TemplateBinding Background}" 
                             CornerRadius="2">
                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Border>
                        <ControlTemplate.Triggers>


                        </ControlTemplate.Triggers>
                    </ControlTemplate>

                </Setter.Value>

            </Setter>
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="#0066cc"/>
                    <Setter Property="Foreground" Value="White"/>
                </Trigger>
            </Style.Triggers>

        </Style>

        <Style x:Key="DarkButton" TargetType="Button">
            <Setter Property="Background" Value="#222222"/>
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="FontSize" Value="14"/>
            <Setter Property="Height" Value="40"/>
            <Setter Property="Margin" Value="0,5,0,5"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border Background="{TemplateBinding Background}" 
                             CornerRadius="2">
                            <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <Style x:Key="buttonStyle" TargetType="{x:Type Button}">

            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="Background" Value="#333333"></Setter>
            <Setter Property="Foreground" Value="White"></Setter>
            <Setter Property="FontFamily" Value="微软雅黑"></Setter>
            <Setter Property="Height"  Value="40"></Setter>
            <Setter Property="FontSize"  Value="14"></Setter>

            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <Border CornerRadius="5" x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
                            <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsDefaulted" Value="true">
                                <Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="true">
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="false">
                                <Setter Property="Background" TargetName="border" Value="#333333" />
                                <Setter Property="BorderBrush" TargetName="border" Value="#D2FFBB" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Background" Value="#888888"/>
                    <Setter Property="Foreground" Value="White"/>
                </Trigger>
            </Style.Triggers>
        </Style>
        <!-- 蓝色复选框样式 -->
        <Style x:Key="BlueCheckBox" TargetType="{x:Type CheckBox}">
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="VerticalContentAlignment" Value="Center"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type CheckBox}">
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Border x:Name="checkBoxBorder" 
                                 Width="18" Height="18" 
                                 Background="#333333" 
                                 BorderThickness="1"
                                 BorderBrush="#444444"
                                 VerticalAlignment="Center">
                                <Path x:Name="checkMark"
                                 Fill="#007BFF"
                                 Data="M3,8 L7,12 L14,3"
                                 Stretch="Uniform"
                                 Width="10"
                                 Height="10"
                                 Visibility="Collapsed"/>
                            </Border>
                            <ContentPresenter Grid.Column="1" 
                                         Margin="5,0,0,0" 
                                         VerticalAlignment="Center" 
                                         HorizontalAlignment="Left"
                                         RecognizesAccessKey="True"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsChecked" Value="True">
                                <Setter TargetName="checkMark" Property="Visibility" Value="Visible"/>
                                <Setter TargetName="checkBoxBorder" Property="Background" Value="#007BFF"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- 日历日按钮样式 -->
        <Style x:Key="CustomCalendarDayButton" TargetType="{x:Type CalendarDayButton}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type CalendarDayButton}">
                        <Grid>
                            <Rectangle x:Name="DayButtonBackground" Fill="Transparent" />
                            <ContentPresenter x:Name="Content" HorizontalAlignment="Center" VerticalAlignment="Center" />
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsSelected" Value="True">
                                <Setter TargetName="DayButtonBackground" Property="Fill" Value="#007BFF"/>
                                <Setter TargetName="Content" Property="TextElement.Foreground" Value="White"/>
                            </Trigger>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="DayButtonBackground" Property="Fill" Value="#444444"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- 日历项模板 -->
        <ControlTemplate x:Key="CalendarItemTemplate" TargetType="{x:Type CalendarItem}">
            <StackPanel>
                <!-- 月份导航栏 -->
                <Grid Background="#DDDDDD" Margin="0,0,0,2">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="Auto"/>
                    </Grid.ColumnDefinitions>

                    <Button Grid.Column="0" Content="◀" Width="30" Background="Transparent" 
                        />

                    <TextBlock Grid.Column="1" 
                           Text="{Binding DisplayDate, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Calendar}}, StringFormat=yyyy年M月}" 
                           HorizontalAlignment="Center" 
                           VerticalAlignment="Center" 
                           FontWeight="Bold"/>

                    <Button Grid.Column="2" Content="▶" Width="30" Background="Transparent"
                        />
                </Grid>

                <!-- 星期标题 -->
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>

                    <TextBlock Grid.Column="0" Text="周一" HorizontalAlignment="Center"/>
                    <TextBlock Grid.Column="1" Text="周二" HorizontalAlignment="Center"/>
                    <TextBlock Grid.Column="2" Text="周三" HorizontalAlignment="Center"/>
                    <TextBlock Grid.Column="3" Text="周四" HorizontalAlignment="Center"/>
                    <TextBlock Grid.Column="4" Text="周五" HorizontalAlignment="Center"/>
                    <TextBlock Grid.Column="5" Text="周六" HorizontalAlignment="Center"/>
                    <TextBlock Grid.Column="6" Text="周日" HorizontalAlignment="Center"/>
                </Grid>

                <!-- 日历主体 -->
                <Grid Margin="0,5,0,0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>

                    <!-- 月历网格 -->
                    <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" 
                        Background="{TemplateBinding Background}" Grid.RowSpan="6">
                        <Grid x:Name="PART_MonthView" Margin="0,-1,0,1" Visibility="Visible">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="*"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                        </Grid>
                    </Border>

                    <!-- 今日标记 -->
                    <Border Grid.Row="6" BorderBrush="Transparent" BorderThickness="0">
                        <TextBlock Text="{Binding Path=Today, StringFormat='今天: {0:yyyy/M/d}', RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Calendar}}}" 
                               Padding="5,0" HorizontalAlignment="Left" Margin="2,2,0,2"/>
                    </Border>
                </Grid>
            </StackPanel>
        </ControlTemplate>

        <!-- 日历样式 -->
        <Style x:Key="CustomCalendar" TargetType="{x:Type Calendar}">
            <Setter Property="Background" Value="#FFF0F0F0"/>
            <Setter Property="Foreground" Value="#FF333333"/>
            <Setter Property="BorderBrush" Value="#FFABADB3"/>
            <Setter Property="CalendarDayButtonStyle" Value="{StaticResource CustomCalendarDayButton}"/>
            <!--<Setter Property="CalendarItemTemplate" Value="{StaticResource CalendarItemTemplate}"/>-->
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Calendar}">
                        <Border Background="#EEEEEE" BorderBrush="#666666" BorderThickness="1">
                            <CalendarItem Background="Transparent" 
                                     BorderThickness="0"
                                     Template="{StaticResource CalendarItemTemplate}"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <!-- 日期选择器样式 -->
        <Style x:Key="CustomDatePicker" TargetType="{x:Type DatePicker}">
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="Background" Value="#1A1A1A"/>
            <Setter Property="BorderBrush" Value="#333333"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Height" Value="30"/>
            <!-- 添加一个附加属性用于存储复选框状态 -->
            <Setter Property="Tag" Value="True"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type DatePicker}">
                        <Border Background="{TemplateBinding Background}"
                     BorderBrush="{TemplateBinding BorderBrush}"
                     BorderThickness="{TemplateBinding BorderThickness}"
                     CornerRadius="3">
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>

                                <!-- 可交互的蓝色复选框 -->
                                <CheckBox Grid.Column="0" 
                              x:Name="PART_CheckBox"
                              Margin="8,0,6,0" 
                              VerticalAlignment="Center"
                              IsChecked="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}">
                                    <CheckBox.Template>
                                        <ControlTemplate TargetType="{x:Type CheckBox}">
                                            <Border x:Name="checkBorder" 
                                        Width="16" 
                                        Height="16" 
                                        Background="{TemplateBinding IsChecked, Converter={StaticResource BoolToColorConverter}}"
                                        BorderBrush="#0078D7"
                                        BorderThickness="1">
                                                <Path x:Name="checkMark" 
                                          Data="M1,5 L4,9 L9,2" 
                                          Stroke="White" 
                                          StrokeThickness="1.5"
                                          Stretch="Uniform" 
                                          Width="9" 
                                          Height="9"
                                          Visibility="{TemplateBinding IsChecked, Converter={StaticResource BoolToVisibilityConverter}}"/>
                                            </Border>
                                        </ControlTemplate>
                                    </CheckBox.Template>
                                </CheckBox>

                                <!-- 日期文本 -->
                                <TextBlock Grid.Column="1"
                               Text="{Binding SelectedDate, RelativeSource={RelativeSource TemplatedParent}, StringFormat=yyyy-MM-dd}"
                               VerticalAlignment="Center"
                               Foreground="White"
                               Margin="0,0,0,0"/>

                                <!-- 蓝色下拉箭头 -->
                                <Path Grid.Column="2" 
                           Data="M0,0 L4,4 L8,0" 
                           Fill="#0078D7"
                           Width="8" 
                           Height="4"
                           Stretch="Fill"
                           VerticalAlignment="Center"
                           Margin="0,0,8,0"/>

                                <!-- 隐藏的实际日期选择器控件 -->
                                <DatePickerTextBox x:Name="PART_TextBox" 
                                      Grid.Column="0" 
                                      Grid.ColumnSpan="3"
                                      Visibility="Hidden"/>

                                <Popup x:Name="PART_Popup" 
                            StaysOpen="False" 
                            Placement="Bottom"
                            AllowsTransparency="True"
                            IsOpen="{Binding Path=IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}">
                                    <Border Background="#333333" 
                                 BorderBrush="#444444" 
                                 BorderThickness="1" 
                                 Padding="5"
                                 CornerRadius="3">
                                        <Calendar x:Name="PART_Calendar" 
                                       Background="#333333"
                                       BorderBrush="Transparent"
                                       Foreground="White"
                                       SelectedDate="{Binding SelectedDate, RelativeSource={RelativeSource TemplatedParent}}">
                                            <!-- 日历样式资源 -->
                                        </Calendar>
                                    </Border>
                                </Popup>

                                <!-- 日期选择区域按钮 (不覆盖复选框) -->
                                <Button x:Name="PART_Button" 
                             Grid.Column="1" 
                             Grid.ColumnSpan="2"
                             Background="Transparent"
                             BorderBrush="Transparent"
                             Opacity="0"/>
                            </Grid>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="BorderBrush" Value="#444444"/>
                            </Trigger>
                            <Trigger Property="IsKeyboardFocused" Value="True">
                                <Setter Property="BorderBrush" Value="#0078D7"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>




    </UserControl.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="35"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <!-- 顶部标题栏 -->
        <Grid Grid.Row="0" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>

            <StackPanel Grid.Column="0" Orientation="Horizontal" Margin="10,0,0,0">
                <Image Source="/Resources/App.png" Name="logos" />
            </StackPanel>

            <TextBlock Grid.Column="1" Text="追溯" Name="FrmRetrospect_FrmRetrospect" FontSize="14" FontFamily="微软雅黑" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center"/>

            <StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right">
                <Button Content="-" Width="30"  Background="Transparent" Foreground="White" BorderThickness="0" Click="Button_Click_1"/>
                <Button Content="□" Width="30" Background="Transparent" Foreground="White" BorderThickness="0" Click="Button_Click_2"/>
                <Button Content="×" Width="30" Background="Transparent" Foreground="White" BorderThickness="0" Click="Button_Click_3"/>
            </StackPanel>
        </Grid>

        <!-- 主要内容区域 -->
        <Grid Grid.Row="1" Margin="10">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="250"/>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="320"/>
            </Grid.ColumnDefinitions>

            <!-- 左侧面板 -->
            <Grid Grid.Column="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>

                <!-- 日期范围区域 -->
                <TextBlock Grid.Row="0" Name="FrmRetrospect_LblDateRange" Text="日期范围" FontSize="14" FontFamily="微软雅黑" Foreground="White" Margin="0,0,0,5"/>

                <!-- 日期选择器 -->
                <DatePicker Grid.Row="1" Name="startdate" Style="{StaticResource CustomDatePicker}" 
                           Height="36"  FontSize="14" FontFamily="微软雅黑" SelectedDate="{x:Static sys:DateTime.Now}"  xmlns:sys="clr-namespace:System;assembly=mscorlib"
                           Margin="0,5,0,5"/>

                <DatePicker Grid.Row="2" Name="enddate" Style="{StaticResource CustomDatePicker}" 
                           Height="36" FontSize="14" FontFamily="微软雅黑" SelectedDate="{x:Static sys:DateTime.Now}"  xmlns:sys="clr-namespace:System;assembly=mscorlib"
                           Margin="0,5,0,5"/>

                <!-- 条码区域 -->
                <TextBlock Grid.Row="3" Text="条码" FontSize="14" FontFamily="微软雅黑" Name="FrmRetrospect_LblCode"  Foreground="White" Margin="0,15,0,5"/>
                <Grid Grid.Row="4">
                    <TextBox Background="#222222"  FontSize="14" FontFamily="微软雅黑" Name="TxtCode" Foreground="#888888" Text="" Height="36" VerticalContentAlignment="Center" Padding="10,0,30,0"/>
                    <Button Content="×" HorizontalAlignment="Right" Width="30" Background="Transparent" Foreground="#888888" BorderThickness="0"/>
                </Grid>

                <!-- 按钮区域 -->
                <Button Grid.Row="5" FontSize="14" FontFamily="微软雅黑" Style="{StaticResource BlueButton}" Name="FrmRetrospect_BtnSelect" Content="查询" Margin="0,10,0,5" Click="Button_Click"/>
                <StackPanel Grid.Row="6">
                    <Button Style="{StaticResource buttonStyle}" Name="FrmRetrospect_BtnExport" Click="FrmRetrospect_BtnExport_Click" Content="导出" Margin="0,5,0,5"/>
                    <Button Style="{StaticResource buttonStyle}" Name="FrmRetrospect_BtnExportAll" Click="FrmRetrospect_BtnExportAll_Click" Content="导出所有" Margin="0,5,0,5"/>
                    <Button Style="{StaticResource buttonStyle}" Visibility="Collapsed" Name="FrmRetrospect_butt_startserver" Click="FrmRetrospect_butt_startserver_Click" Content="启动服务" Margin="0,5,0,5"/>

                    <!-- 结果显示区域 -->
                    <TextBlock Text="" Name="FrmRetrospect_faceLabel1" Foreground="White" Margin="0,15,0,5"/>
                    <ListView x:Name="data3" 
          Height="150"  
          Background="#1c1c1c" 
          BorderThickness="1"
          BorderBrush="Gray"
          Foreground="White"
          ScrollViewer.VerticalScrollBarVisibility="Auto"
          ScrollViewer.HorizontalScrollBarVisibility="Disabled" SelectionChanged="data3_SelectionChanged">
                        <!-- 设置交替行数为2 -->
                        <ListView.AlternationCount>2</ListView.AlternationCount>

                        <!-- 自定义每个项的显示模板 -->
                        <ListView.ItemTemplate>
                            <DataTemplate>
                                <TextBlock Text="{Binding}" 
                       Foreground="White" 
                       TextAlignment="Center"
                       HorizontalAlignment="Center" 
                       VerticalAlignment="Center" FontSize="14" FontFamily="微软雅黑"/>
                            </DataTemplate>
                        </ListView.ItemTemplate>

                        <ListView.ItemContainerStyle>
                            <Style TargetType="ListViewItem">
                                <Setter Property="HorizontalContentAlignment" Value="Center"/>
                                <Setter Property="VerticalContentAlignment" Value="Center"/>
                                <Setter Property="Height" Value="25"/>
                                <Setter Property="Padding" Value="5,0"/>
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="ListViewItem">
                                            <Border x:Name="Border"
                                Background="{TemplateBinding Background}"
                                BorderThickness="0">
                                                <ContentPresenter HorizontalAlignment="Center" 
                                              VerticalAlignment="Center"/>
                                            </Border>
                                            <ControlTemplate.Triggers>
                                                <Trigger Property="IsSelected" Value="True">
                                                    <Setter TargetName="Border" Property="Background" Value="#005A9E"/>
                                                </Trigger>
                                            </ControlTemplate.Triggers>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                                <Style.Triggers>
                                    <!-- 交替行颜色 -->
                                    <Trigger Property="ItemsControl.AlternationIndex" Value="0">
                                        <Setter Property="Background" Value="#353535"/>
                                    </Trigger>
                                    <Trigger Property="ItemsControl.AlternationIndex" Value="1">
                                        <Setter Property="Background" Value="#2a2a2a"/>
                                    </Trigger>
                                    <!-- 选中行颜色 -->
                                    <Trigger Property="IsSelected" Value="True">
                                        <Setter Property="Background" Value="#0061c8"/>
                                        <Setter Property="BorderBrush" Value="Transparent"/>
                                    </Trigger>
                                    <!-- 鼠标悬停效果 -->
                                    <Trigger Property="IsMouseOver" Value="True">
                                        <Setter Property="Background" Value="#464646"/>
                                    </Trigger>
                                </Style.Triggers>
                            </Style>
                        </ListView.ItemContainerStyle>
                    </ListView>

                </StackPanel>
            </Grid>

            <!-- 中间面板 - 预留为空白区域 -->
            <Grid Grid.Column="1">
                <!-- 中间区域为黑色背景,暂无内容 -->
                <wfh:WindowsFormsHost Name="imageViewer"  Background="Aqua"></wfh:WindowsFormsHost>
            </Grid>

            <!-- 右侧面板 -->
            <Grid Grid.Column="2" Margin="10,0,0,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="auto"/>
                </Grid.RowDefinitions>

                <!-- 打印按钮 -->
                <Button Grid.Row="0" Style="{StaticResource BlueButton}" FontSize="14" FontFamily="微软雅黑" Content="打 印" Name="FrmRetrospect_faceBut_prin" Click="FrmRetrospect_faceBut_prin_Click" Margin="0,0,0,15"/>
                <wfh:WindowsFormsHost Name="imageViewer1"  Grid.Row="1" Height="150" Background="Aqua"></wfh:WindowsFormsHost>
                <!-- 物料条码区域 -->
                <TextBlock Grid.Row="2" FontSize="14" FontFamily="微软雅黑" Text="物料条码" Name="FrmRetrospect_LblAllCode" Foreground="White" Margin="0,0,0,5"/>
                <ListView x:Name="data1"  Grid.Row="3" Height="150"  
Background="#1c1c1c" 
BorderThickness="1"
BorderBrush="Gray"
Foreground="White"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Disabled" >
                    <!-- 设置交替行数为2 -->
                    <ListView.AlternationCount>2</ListView.AlternationCount>

                    <!-- 自定义每个项的显示模板 -->
                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding}"  FontSize="14" FontFamily="微软雅黑"
             Foreground="White" 
             TextAlignment="Center"
             TextWrapping="Wrap"
             HorizontalAlignment="Center" 
             Width="{Binding ActualWidth, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListView}}, Converter={StaticResource WidthMinusMarginConverter}}"
                       Margin="5"
             VerticalAlignment="Center"/>
                        </DataTemplate>
                    </ListView.ItemTemplate>

                    <ListView.ItemContainerStyle>
                        <Style TargetType="ListViewItem">
                            <Setter Property="HorizontalContentAlignment" Value="Center"/>
                            <Setter Property="VerticalContentAlignment" Value="Center"/>
                            <Setter Property="Height" Value="25"/>
                            <Setter Property="Padding" Value="5,0"/>
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="ListViewItem">
                                        <Border x:Name="Border"
                      Background="{TemplateBinding Background}"
                      BorderThickness="0">
                                            <ContentPresenter HorizontalAlignment="Center" 
                                    VerticalAlignment="Center"/>
                                        </Border>
                                        <ControlTemplate.Triggers>
                                            <Trigger Property="IsSelected" Value="True">
                                                <Setter TargetName="Border" Property="Background" Value="#005A9E"/>
                                            </Trigger>
                                        </ControlTemplate.Triggers>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                            <Style.Triggers>
                                <!-- 交替行颜色 -->
                                <Trigger Property="ItemsControl.AlternationIndex" Value="0">
                                    <Setter Property="Background" Value="#353535"/>
                                </Trigger>
                                <Trigger Property="ItemsControl.AlternationIndex" Value="1">
                                    <Setter Property="Background" Value="#2a2a2a"/>
                                </Trigger>
                                <!-- 选中行颜色 -->
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter Property="Background" Value="#0061c8"/>
                                    <Setter Property="BorderBrush" Value="Transparent"/>
                                </Trigger>
                                <!-- 鼠标悬停效果 -->
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter Property="Background" Value="#464646"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </ListView.ItemContainerStyle>
                </ListView>

                <!-- 标签内容区域 -->
                <TextBlock Grid.Row="4" FontSize="14" FontFamily="微软雅黑" Text="标签内容" Name="FrmRetrospect_LblAllLabel" Foreground="White" Margin="0,15,0,5"/>
                <ListView x:Name="data2"  Grid.Row="5"
Height="150"  
Background="#1c1c1c" 
BorderThickness="1"
BorderBrush="Gray"
Foreground="White"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Disabled" >
                    <!-- 设置交替行数为2 -->
                    <ListView.AlternationCount>2</ListView.AlternationCount>

                    <!-- 自定义每个项的显示模板 -->
                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding}" FontSize="14" FontFamily="微软雅黑" 
             Foreground="White" 
             TextAlignment="Center"
             HorizontalAlignment="Center" 
             VerticalAlignment="Center"/>
                        </DataTemplate>
                    </ListView.ItemTemplate>

                    <ListView.ItemContainerStyle>
                        <Style TargetType="ListViewItem">
                            <Setter Property="HorizontalContentAlignment" Value="Center"/>
                            <Setter Property="VerticalContentAlignment" Value="Center"/>
                            <Setter Property="Height" Value="25"/>
                            <Setter Property="Padding" Value="5,0"/>
                            <Setter Property="Template">
                                <Setter.Value>
                                    <ControlTemplate TargetType="ListViewItem">
                                        <Border x:Name="Border"
                      Background="{TemplateBinding Background}"
                      BorderThickness="0">
                                            <ContentPresenter HorizontalAlignment="Center" 
                                    VerticalAlignment="Center"/>
                                        </Border>
                                        <ControlTemplate.Triggers>
                                            <Trigger Property="IsSelected" Value="True">
                                                <Setter TargetName="Border" Property="Background" Value="#005A9E"/>
                                            </Trigger>
                                        </ControlTemplate.Triggers>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                            <Style.Triggers>
                                <!-- 交替行颜色 -->
                                <Trigger Property="ItemsControl.AlternationIndex" Value="0">
                                    <Setter Property="Background" Value="#353535"/>
                                </Trigger>
                                <Trigger Property="ItemsControl.AlternationIndex" Value="1">
                                    <Setter Property="Background" Value="#2a2a2a"/>
                                </Trigger>
                                <!-- 选中行颜色 -->
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter Property="Background" Value="#0061c8"/>
                                    <Setter Property="BorderBrush" Value="Transparent"/>
                                </Trigger>
                                <!-- 鼠标悬停效果 -->
                                <Trigger Property="IsMouseOver" Value="True">
                                    <Setter Property="Background" Value="#464646"/>
                                </Trigger>
                            </Style.Triggers>
                        </Style>
                    </ListView.ItemContainerStyle>
                </ListView>
            </Grid>
        </Grid>
    </Grid>
</UserControl>