XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet

XFEToolBox

【WPF】XFE工具箱

公开
关注 0 Fork 0 Star 0
UTF-8
<Page x:Class="XFEToolBox.Client.Views.Pages.ToolBoxPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:controls="clr-namespace:XFEToolBox.WpfCore.Controls;assembly=XFEToolBox.WpfCore"
      Background="Transparent" Title="" Loaded="Page_Loaded">
    <Page.Resources>
        <Style x:Key="CategoryComboBoxItemStyle" TargetType="ComboBoxItem">
            <Setter Property="Padding" Value="9,7"/>
            <Setter Property="Margin" Value="0,1"/>
            <Setter Property="Foreground" Value="#4F4F64"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="Cursor" Value="Hand"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ComboBoxItem">
                        <Border x:Name="ItemSurface" Padding="{TemplateBinding Padding}" Background="{TemplateBinding Background}"
                                BorderBrush="Transparent" BorderThickness="1" CornerRadius="8">
                            <Grid>
                                <Grid.ColumnDefinitions><ColumnDefinition Width="3"/><ColumnDefinition Width="*"/></Grid.ColumnDefinitions>
                                <Border x:Name="SelectedMark" Width="3" Height="14" CornerRadius="2"
                                        Background="Transparent" VerticalAlignment="Center"/>
                                <ContentPresenter Grid.Column="1" Margin="8,0,2,0" VerticalAlignment="Center"
                                                  TextElement.Foreground="{TemplateBinding Foreground}"/>
                            </Grid>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsHighlighted" Value="True">
                                <Setter TargetName="ItemSurface" Property="Background" Value="#F4F4FC"/>
                                <Setter TargetName="ItemSurface" Property="BorderBrush" Value="#E5E5F5"/>
                                <Setter Property="Foreground" Value="#6262B9"/>
                            </Trigger>
                            <Trigger Property="IsSelected" Value="True">
                                <Setter TargetName="ItemSurface" Property="Background" Value="#ECECFB"/>
                                <Setter TargetName="ItemSurface" Property="BorderBrush" Value="#D2D2F1"/>
                                <Setter TargetName="SelectedMark" Property="Background" Value="{DynamicResource MainColor}"/>
                                <Setter Property="Foreground" Value="#5555B5"/>
                                <Setter Property="FontWeight" Value="SemiBold"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="CategoryComboBoxStyle" TargetType="ComboBox">
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="Background" Value="#1EFFFFFF"/>
            <Setter Property="BorderBrush" Value="#A8FFFFFF"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Padding" Value="12,0,8,0"/>
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="ItemContainerStyle" Value="{StaticResource CategoryComboBoxItemStyle}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ComboBox">
                        <Grid x:Name="ComboRoot" SnapsToDevicePixels="True">
                            <Border x:Name="ComboSurface" Background="{TemplateBinding Background}"
                                    BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}"
                                    CornerRadius="11"/>
                            <ToggleButton x:Name="DropDownToggle" Focusable="False" ClickMode="Press" Cursor="Hand"
                                          IsChecked="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                          Background="Transparent" BorderThickness="0" Foreground="{TemplateBinding Foreground}"
                                          Padding="{TemplateBinding Padding}">
                                <ToggleButton.Template>
                                    <ControlTemplate TargetType="ToggleButton">
                                        <Grid Background="Transparent">
                                            <Grid.ColumnDefinitions><ColumnDefinition Width="*"/><ColumnDefinition Width="24"/></Grid.ColumnDefinitions>
                                            <ContentPresenter Margin="{TemplateBinding Padding}" VerticalAlignment="Center" HorizontalAlignment="Left"
                                                              Content="{Binding SelectionBoxItem, RelativeSource={RelativeSource AncestorType=ComboBox}}"
                                                              ContentTemplate="{Binding SelectionBoxItemTemplate, RelativeSource={RelativeSource AncestorType=ComboBox}}"
                                                              ContentTemplateSelector="{Binding ItemTemplateSelector, RelativeSource={RelativeSource AncestorType=ComboBox}}"
                                                              ContentStringFormat="{Binding SelectionBoxItemStringFormat, RelativeSource={RelativeSource AncestorType=ComboBox}}"
                                                              TextElement.Foreground="{TemplateBinding Foreground}"/>
                                            <Path x:Name="Arrow" Grid.Column="1" Width="8" Height="5" Stretch="Fill" Fill="#F4F4FF"
                                                  HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5"
                                                  Data="M 0,0 L 4,4 L 8,0 Z">
                                                <Path.RenderTransform><RotateTransform Angle="0"/></Path.RenderTransform>
                                            </Path>
                                        </Grid>
                                        <ControlTemplate.Triggers>
                                            <Trigger Property="IsChecked" Value="True">
                                                <Setter TargetName="Arrow" Property="RenderTransform">
                                                    <Setter.Value><RotateTransform Angle="180"/></Setter.Value>
                                                </Setter>
                                            </Trigger>
                                        </ControlTemplate.Triggers>
                                    </ControlTemplate>
                                </ToggleButton.Template>
                            </ToggleButton>
                            <Popup x:Name="PART_Popup" Placement="Bottom" IsOpen="{TemplateBinding IsDropDownOpen}"
                                   AllowsTransparency="True" Focusable="False" PopupAnimation="Fade">
                                <Border MinWidth="{Binding ActualWidth, ElementName=ComboRoot}" Margin="0,7,0,0" Padding="6"
                                        Background="#FEFEFF" BorderBrush="#CECEE8" BorderThickness="1" CornerRadius="12">
                                    <Border.Effect><DropShadowEffect Color="#3C365D" BlurRadius="20" ShadowDepth="4" Opacity="0.20"/></Border.Effect>
                                    <ScrollViewer MaxHeight="230" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
                                        <ItemsPresenter KeyboardNavigation.DirectionalNavigation="Contained"/>
                                    </ScrollViewer>
                                </Border>
                            </Popup>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="ComboSurface" Property="Background" Value="#2AFFFFFF"/>
                                <Setter TargetName="ComboSurface" Property="BorderBrush" Value="#DCFFFFFF"/>
                            </Trigger>
                            <Trigger Property="IsDropDownOpen" Value="True">
                                <Setter TargetName="ComboSurface" Property="Background" Value="#38FFFFFF"/>
                                <Setter TargetName="ComboSurface" Property="BorderBrush" Value="White"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False"><Setter Property="Opacity" Value="0.58"/></Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="ToolCardStyle" TargetType="Button">
            <Setter Property="Height" Value="142"/>
            <Setter Property="Margin" Value="5"/>
            <Setter Property="Padding" Value="0"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="VerticalContentAlignment" Value="Stretch"/>
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="Cursor" Value="Hand"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Border x:Name="CardSurface" Margin="2" Padding="15" Background="White"
                                BorderBrush="#E7E7F1" BorderThickness="1" CornerRadius="16"
                                RenderTransformOrigin="0.5,0.5">
                            <Border.RenderTransform><ScaleTransform ScaleX="1" ScaleY="1"/></Border.RenderTransform>
                            <Border.Effect><DropShadowEffect Color="#7777C9" BlurRadius="14" ShadowDepth="3" Opacity="0.06"/></Border.Effect>
                            <ContentPresenter/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter TargetName="CardSurface" Property="Background" Value="#FCFCFF"/>
                                <Setter TargetName="CardSurface" Property="BorderBrush" Value="#BEBEEE"/>
                                <Setter TargetName="CardSurface" Property="Effect">
                                    <Setter.Value><DropShadowEffect Color="#7777C9" BlurRadius="18" ShadowDepth="4" Opacity="0.20"/></Setter.Value>
                                </Setter>
                                <Setter TargetName="CardSurface" Property="RenderTransform">
                                    <Setter.Value><ScaleTransform ScaleX="1.016" ScaleY="1.016"/></Setter.Value>
                                </Setter>
                            </Trigger>
                            <Trigger Property="IsPressed" Value="True">
                                <Setter TargetName="CardSurface" Property="RenderTransform">
                                    <Setter.Value><ScaleTransform ScaleX="0.985" ScaleY="0.985"/></Setter.Value>
                                </Setter>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False">
                                <Setter TargetName="CardSurface" Property="Opacity" Value="0.62"/>
                                <Setter Property="Cursor" Value="Wait"/>
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="ToolCardMenuItemStyle" TargetType="MenuItem">
            <Setter Property="Height" Value="34"/>
            <Setter Property="Margin" Value="4,2"/>
            <Setter Property="Padding" Value="11,0"/>
            <Setter Property="Foreground" Value="#55556D"/>
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="Cursor" Value="Hand"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="MenuItem">
                        <Border x:Name="MenuSurface" Background="{TemplateBinding Background}" CornerRadius="8"
                                Padding="{TemplateBinding Padding}">
                            <TextBlock Text="{TemplateBinding Header}" FontSize="11" VerticalAlignment="Center"/>
                        </Border>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsHighlighted" Value="True">
                                <Setter TargetName="MenuSurface" Property="Background" Value="#EEEEFB"/>
                                <Setter Property="Foreground" Value="#6969C8"/>
                            </Trigger>
                            <Trigger Property="IsEnabled" Value="False"><Setter Property="Opacity" Value="0.48"/></Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="ToolCardContextMenuStyle" TargetType="ContextMenu">
            <Setter Property="Background" Value="Transparent"/>
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="HasDropShadow" Value="True"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ContextMenu">
                        <Border Background="#FEFEFF" BorderBrush="#D9D9EC" BorderThickness="1"
                                CornerRadius="12" Padding="3" MinWidth="158">
                            <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Cycle"/>
                        </Border>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <DataTemplate x:Key="ToolCardContentTemplate">
            <Button Style="{StaticResource ToolCardStyle}" CommandParameter="{Binding}"
                    IsEnabled="{Binding IsEnabled}" Click="ToolCard_Click">
                <Button.ContextMenu>
                    <ContextMenu Style="{StaticResource ToolCardContextMenuStyle}"
                                 DataContext="{Binding PlacementTarget.CommandParameter, RelativeSource={RelativeSource Self}}">
                        <MenuItem Header="打开工具" Style="{StaticResource ToolCardMenuItemStyle}"
                                  CommandParameter="{Binding}" Click="OpenToolMenuItem_Click"/>
                        <MenuItem Header="工具配置" Style="{StaticResource ToolCardMenuItemStyle}"
                                  CommandParameter="{Binding}" Click="ToolConfigurationMenuItem_Click"/>
                        <MenuItem Header="固定/取消固定到主页" Style="{StaticResource ToolCardMenuItemStyle}"
                                  CommandParameter="{Binding}" Click="TogglePinnedToolMenuItem_Click"/>
                        <MenuItem Header="清除该工具的数据" Style="{StaticResource ToolCardMenuItemStyle}"
                                  CommandParameter="{Binding}" Click="ClearToolDataMenuItem_Click"/>
                    </ContextMenu>
                </Button.ContextMenu>
                <Grid ClipToBounds="True">
                    <Grid.ColumnDefinitions><ColumnDefinition Width="58"/><ColumnDefinition Width="*"/></Grid.ColumnDefinitions>
                    <Grid Width="52" Height="52" VerticalAlignment="Top" HorizontalAlignment="Left">
                        <Border Width="48" Height="48" CornerRadius="14" Background="#EEEEFB"
                                VerticalAlignment="Top" HorizontalAlignment="Left">
                            <Image Source="{Binding IconSource}" Width="29" Height="29" Stretch="Uniform"/>
                        </Border>
                        <Border x:Name="UacBadge" Width="22" Height="22" Padding="2" Background="White"
                                BorderBrush="#D6D6E8" BorderThickness="1" CornerRadius="8"
                                HorizontalAlignment="Right" VerticalAlignment="Bottom" Visibility="Collapsed"
                                ToolTip="{Binding AdministratorLaunchDescription}">
                            <Image Source="{Binding UacIconSource}" Stretch="Uniform"/>
                        </Border>
                    </Grid>
                    <Grid Grid.Column="1">
                        <Grid.RowDefinitions><RowDefinition Height="Auto"/><RowDefinition Height="*"/><RowDefinition Height="Auto"/></Grid.RowDefinitions>
                        <DockPanel LastChildFill="True">
                            <Border DockPanel.Dock="Right" Margin="7,0,0,0" Padding="7,3" Background="#EEEEFB" CornerRadius="7">
                                <TextBlock Text="{Binding CacheState}" Foreground="#6F6FC8" FontSize="9.5"/>
                            </Border>
                            <controls:ScrollTextBlock InnerText="{Binding Name}" Height="22"
                                                      InnerFontSize="14" InnerFontWeight="SemiBold" InnerForeground="#3D3D52"
                                                      InnerTextAlignment="Left" AutoAlignment="False" AutoRolling="False"
                                                      IsRolling="{Binding IsMouseOver, RelativeSource={RelativeSource AncestorType=Button}, Mode=OneWay}"
                                                      RollingBack="True" RollingTimeMillisecond="2800"/>
                        </DockPanel>
                        <TextBlock Grid.Row="1" Text="{Binding Description}" Margin="0,8,0,8" Foreground="#7F7F91" FontSize="10.5"
                                   TextWrapping="Wrap" TextTrimming="CharacterEllipsis" MaxHeight="45"/>
                        <Grid x:Name="NormalFooter" Grid.Row="2">
                            <Grid.ColumnDefinitions><ColumnDefinition Width="*"/><ColumnDefinition Width="Auto"/></Grid.ColumnDefinitions>
                            <controls:ScrollTextBlock InnerText="{Binding Author}" Height="18" Margin="0,0,72,0"
                                                      InnerFontSize="9.5" InnerForeground="#A0A0B0"
                                                      InnerTextAlignment="Left" AutoAlignment="False" AutoRolling="False"
                                                      IsRolling="{Binding IsMouseOver, RelativeSource={RelativeSource AncestorType=Button}, Mode=OneWay}"
                                                      RollingBack="True" RollingTimeMillisecond="2600"/>
                            <TextBlock Grid.Column="1" Text="{Binding LatestVersion, StringFormat=v{0}}"
                                       Foreground="#8585D8" FontSize="9.5" VerticalAlignment="Center"/>
                        </Grid>
                        <Grid x:Name="DownloadFooter" Grid.Row="2" Visibility="Collapsed">
                            <Grid.RowDefinitions><RowDefinition Height="Auto"/><RowDefinition Height="Auto"/></Grid.RowDefinitions>
                            <TextBlock Text="{Binding DownloadProgressText}" Foreground="#7777C9" FontSize="8.8"
                                       TextTrimming="CharacterEllipsis"/>
                            <ProgressBar Grid.Row="1" Height="4" Margin="0,4,0,0" Minimum="0" Maximum="100"
                                         Value="{Binding DownloadProgress}" IsIndeterminate="{Binding IsDownloadIndeterminate}"/>
                        </Grid>
                    </Grid>
                </Grid>
            </Button>
            <DataTemplate.Triggers>
                <DataTrigger Binding="{Binding IsDownloading}" Value="True">
                    <Setter TargetName="NormalFooter" Property="Visibility" Value="Collapsed"/>
                    <Setter TargetName="DownloadFooter" Property="Visibility" Value="Visible"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding RunAsAdministrator}" Value="True">
                    <Setter TargetName="UacBadge" Property="Visibility" Value="Visible"/>
                </DataTrigger>
            </DataTemplate.Triggers>
        </DataTemplate>

        <DataTemplate x:Key="ToolCategoryHeaderTemplate">
            <Border Margin="5,9,5,2" Padding="12,8" Background="#F9F9FD"
                    BorderBrush="#E6E6F2" BorderThickness="1" CornerRadius="13">
                <Grid>
                    <Grid.ColumnDefinitions><ColumnDefinition Width="3"/><ColumnDefinition Width="*"/><ColumnDefinition Width="Auto"/></Grid.ColumnDefinitions>
                    <Border Width="3" Height="21" Background="{Binding Category.AccentBrush}" CornerRadius="2"/>
                    <TextBlock Grid.Column="1" Text="{Binding Category.Name}" Margin="10,0,0,0" Foreground="#414155"
                               FontSize="13.5" FontWeight="SemiBold" VerticalAlignment="Center"/>
                    <Border Grid.Column="2" Padding="9,4" Background="{Binding Category.TintBrush}" CornerRadius="9" VerticalAlignment="Center">
                        <StackPanel Orientation="Horizontal">
                            <Ellipse Width="5" Height="5" Fill="{Binding Category.AccentBrush}" Margin="0,0,6,0" VerticalAlignment="Center"/>
                            <TextBlock Text="{Binding Category.CountText}" Foreground="{Binding Category.AccentBrush}" FontSize="9.5" FontWeight="SemiBold"/>
                        </StackPanel>
                    </Border>
                </Grid>
            </Border>
        </DataTemplate>

        <DataTemplate x:Key="ToolCardsRowTemplate">
            <Grid>
                <Grid.ColumnDefinitions><ColumnDefinition Width="*"/><ColumnDefinition Width="*"/></Grid.ColumnDefinitions>
                <ContentControl Content="{Binding PrimaryCard}" ContentTemplate="{StaticResource ToolCardContentTemplate}"/>
                <ContentControl Grid.Column="1" Content="{Binding SecondaryCard}" ContentTemplate="{StaticResource ToolCardContentTemplate}"
                                Visibility="{Binding SecondaryCardVisibility}"/>
            </Grid>
        </DataTemplate>

        <DataTemplate x:Key="ToolCatalogRowTemplate">
            <ContentControl Content="{Binding}" Focusable="False">
                <ContentControl.Style>
                    <Style TargetType="ContentControl">
                        <Setter Property="ContentTemplate" Value="{StaticResource ToolCardsRowTemplate}"/>
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding IsHeader}" Value="True">
                                <Setter Property="ContentTemplate" Value="{StaticResource ToolCategoryHeaderTemplate}"/>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </ContentControl.Style>
            </ContentControl>
        </DataTemplate>
    </Page.Resources>

    <Grid Margin="14,10,14,12">
        <Grid.RowDefinitions><RowDefinition Height="Auto"/><RowDefinition Height="*"/><RowDefinition Height="Auto"/></Grid.RowDefinitions>
        <Grid Margin="0,0,0,10">
            <Grid.ColumnDefinitions><ColumnDefinition Width="*"/><ColumnDefinition Width="128"/><ColumnDefinition Width="Auto"/><ColumnDefinition Width="Auto"/></Grid.ColumnDefinitions>
            <controls:TextEditor x:Name="SearchTextBox" Height="38" Padding="11,0" Background="#1EFFFFFF" Foreground="White" CaretBrush="White"
                                 EditorCornerRadius="11" EditorBorderBrush="#A8FFFFFF" EditorHoverBorderBrush="#DCFFFFFF" EditorFocusedBorderBrush="White"
                                 HintText="搜索工具名称、介绍、作者或标签" HintForeground="#EEEEFF" HintTextMargin="0" Icon="{StaticResource SearchIconGeometry}"
                                 IconBrush="#F4F4FF" ToolTip="搜索工具名称、介绍、作者或标签" KeyDown="SearchTextBox_KeyDown"/>
            <ComboBox x:Name="CategoryFilter" Grid.Column="1" Height="38" Margin="8,0,0,0"
                      Style="{StaticResource CategoryComboBoxStyle}" VerticalContentAlignment="Center"
                      SelectionChanged="CategoryFilter_SelectionChanged"/>
            <Button x:Name="SearchButton" Grid.Column="2" Content="搜索" controls:ButtonAssist.IsPrimary="True" Height="38" Margin="8,0,0,0"
                    Background="#2AFFFFFF" Foreground="White" BorderBrush="#B8FFFFFF" BorderThickness="1"
                    controls:ButtonAssist.CornerRadius="11"
                    controls:ButtonAssist.HoverBackground="#42FFFFFF" controls:ButtonAssist.HoverForeground="White" controls:ButtonAssist.HoverBorderBrush="White"
                    controls:ButtonAssist.PressedBackground="#20FFFFFF" controls:ButtonAssist.PressedForeground="White" controls:ButtonAssist.PressedBorderBrush="#E8FFFFFF"
                    Click="SearchButton_Click"/>
            <Button x:Name="RefreshButton" Grid.Column="3" Content="刷新" Height="38" Margin="8,0,0,0" Click="RefreshButton_Click"/>
        </Grid>

        <Border Grid.Row="1" Background="White" CornerRadius="18" Padding="7">
            <Grid>
                <ListBox x:Name="ToolCards" Background="Transparent" BorderThickness="0" Padding="0"
                         Focusable="False" HorizontalContentAlignment="Stretch"
                         ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Auto"
                         ScrollViewer.CanContentScroll="True" VirtualizingPanel.IsVirtualizing="True"
                         VirtualizingPanel.VirtualizationMode="Recycling" VirtualizingPanel.ScrollUnit="Pixel"
                         VirtualizingPanel.CacheLength="1" VirtualizingPanel.CacheLengthUnit="Page"
                         ItemTemplate="{StaticResource ToolCatalogRowTemplate}">
                    <ListBox.ItemsPanel><ItemsPanelTemplate><VirtualizingStackPanel/></ItemsPanelTemplate></ListBox.ItemsPanel>
                    <ListBox.ItemContainerStyle>
                        <Style TargetType="ListBoxItem">
                            <Setter Property="Padding" Value="0"/>
                            <Setter Property="Margin" Value="0"/>
                            <Setter Property="Background" Value="Transparent"/>
                            <Setter Property="BorderThickness" Value="0"/>
                            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
                            <Setter Property="Focusable" Value="False"/>
                            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
                            <Setter Property="Template">
                                <Setter.Value><ControlTemplate TargetType="ListBoxItem"><ContentPresenter HorizontalAlignment="Stretch"/></ControlTemplate></Setter.Value>
                            </Setter>
                        </Style>
                    </ListBox.ItemContainerStyle>
                </ListBox>

                <StackPanel x:Name="EmptyState" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed">
                    <Border Width="58" Height="58" Background="#ECECF8" CornerRadius="19" HorizontalAlignment="Center">
                        <Image Source="/XFEToolBox.WpfCore;component/Resources/Image/wrench_tool.png" Width="30" Height="30" Opacity="0.7"/>
                    </Border>
                    <TextBlock Text="暂时没有找到工具" Foreground="#68687D" FontSize="13" FontWeight="SemiBold" HorizontalAlignment="Center" Margin="0,11,0,0"/>
                    <TextBlock Text="可以换个关键词或分类,或稍后刷新再试" Foreground="#A0A0B0" FontSize="10" HorizontalAlignment="Center" Margin="0,4,0,0"/>
                </StackPanel>
            </Grid>
        </Border>

        <Grid Grid.Row="2" Margin="4,9,4,0">
            <TextBlock x:Name="StatusText" Text="准备就绪" Margin="0,0,120,0" Foreground="White" FontSize="10.5" VerticalAlignment="Center" TextTrimming="CharacterEllipsis"/>
            <TextBlock x:Name="ToolCountText" HorizontalAlignment="Right" Foreground="#DEDEFA" FontSize="10" VerticalAlignment="Center"/>
        </Grid>
    </Grid>
</Page>