1480 lines
84 KiB
Plaintext
Raw Normal View History

2025-08-15 16:34:31 +08:00
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:SWS.CAD.Views.CustomControl"
xmlns:po="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
<!-- 系统颜色 -->
<SolidColorBrush x:Key="ColorPrimary" Color="#026BE3" />
<SolidColorBrush x:Key="ColorSecond" Color="#02ADFF" />
<SolidColorBrush x:Key="ColorOther" Color="#DBE0E4" />
<!-- style放后面单纯的属性放前面否则解析顺序不对 -->
<!-- modalwindow -->
<Style x:Key="CustomWindowStyle" TargetType="Window">
<Setter Property="AllowsTransparency" Value="True" />
<Setter Property="Background" Value="White" />
<Setter Property="ResizeMode" Value="NoResize" />
<Setter Property="WindowStyle" Value="None" />
</Style>
<!-- 系统按钮风格 -->
<Style x:Key="sysBtn" TargetType="Button">
<Setter Property="Width" Value="65" />
<Setter Property="Height" Value="26" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="12" />
<Setter Property="Foreground" Value="White" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="{StaticResource ColorSecond}" />
<Style.Triggers>
<!-- 鼠标滑过时的背景颜色和前景颜色 -->
<DataTrigger Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="True">
<Setter Property="Background" Value="Red" />
<!-- 高亮背景色 -->
<Setter Property="Foreground" Value="Black" />
</DataTrigger>
2025-09-23 16:38:40 +08:00
<!-- 按钮禁用时 -->
<DataTrigger Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false">
<Setter Property="Foreground" Value="Black" />
</DataTrigger>
2025-08-15 16:34:31 +08:00
</Style.Triggers>
</Style>
<Style x:Key="sysBtn2" TargetType="Button">
<Setter Property="Width" Value="65" />
<Setter Property="Height" Value="26" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="12" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="{StaticResource ColorOther}" />
<Style.Triggers>
<!-- 鼠标滑过时的背景颜色和前景颜色 -->
<DataTrigger Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="True">
<Setter Property="Background" Value="Red" />
<!-- 高亮背景色 -->
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="sysBtn3" TargetType="Button">
<Setter Property="Width" Value="120" />
<Setter Property="Height" Value="40" />
<Setter Property="Margin" Value="5,2,5,2" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="13" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="{StaticResource ColorOther}" />
<Style.Triggers>
<!-- 鼠标滑过时的背景颜色和前景颜色 -->
<DataTrigger Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="True">
<Setter Property="Background" Value="{StaticResource ColorOther}" />
<!-- 高亮背景色 -->
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="sysBtn4" TargetType="Button">
<Setter Property="Width" Value="120" />
<Setter Property="Height" Value="40" />
<Setter Property="Margin" Value="5,2,5,2" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="13" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="{StaticResource ColorSecond}" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{StaticResource ColorSecond}" />
<!-- 保持背景色不变 -->
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="sysBtn5" TargetType="Button">
<Setter Property="Width" Value="90" />
<Setter Property="Height" Value="26" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="12" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="{StaticResource ColorOther}" />
<Style.Triggers>
<!-- 鼠标滑过时的背景颜色和前景颜色 -->
<DataTrigger Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="True">
<Setter Property="Background" Value="Red" />
<!-- 高亮背景色 -->
</DataTrigger>
</Style.Triggers>
</Style>
<Style x:Key="sysBtn6" TargetType="Button">
<Setter Property="Width" Value="90" />
<Setter Property="Height" Value="26" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="12" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="{StaticResource ColorSecond}" />
</Style>
<Style x:Key="sysBtn7" TargetType="Button">
<Setter Property="Width" Value="90" />
<Setter Property="Height" Value="26" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="12" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="{StaticResource ColorOther}" />
</Style>
<!-- 系统textblock -->
<Style x:Key="sysLabel" TargetType="TextBlock">
<Setter Property="Height" Value="20" />
<Setter Property="Margin" Value="0,5,0,0" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<Style x:Key="sysLabel2" TargetType="TextBlock">
<Setter Property="Width" Value="Auto" />
<Setter Property="Height" Value="15" />
<Setter Property="Margin" Value="5,0,0,0" />
<Setter Property="Foreground" Value="White" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
<!-- 系统textbox -->
<Style x:Key="sysTextBox" TargetType="TextBox">
<Setter Property="Height" Value="24" />
<Setter Property="Margin" Value="5,5,5,0" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
</Style>
<Style x:Key="WhiteStyle" TargetType="TextBox">
<Setter Property="Foreground" Value="White" />
<Setter Property="Background" Value="#2d3135" />
<Setter Property="BorderBrush" Value="Black" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
</Style>
<Style x:Key="sysDescribeTextBox" TargetType="TextBox">
<Setter Property="Height" Value="50" />
<Setter Property="Width" Value="213" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="AcceptsReturn" Value="True" />
<Setter Property="Margin" Value="5,5,5,0" />
<Setter Property="Padding" Value="0" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Top" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
</Style>
<Style x:Key="sysTextAreaInfo" TargetType="TextBox">
<Setter Property="Height" Value="100" />
<Setter Property="Width" Value="300" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="AcceptsReturn" Value="True" />
<Setter Property="Margin" Value="10,5,10,5" />
<Setter Property="Padding" Value="0" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Top" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
</Style>
<!-- 全局 RadFilePathPicker 样式 -->
<Style x:Key="sysFilePathPicker" TargetType="telerik:RadFilePathPicker">
<Setter Property="Height" Value="24" />
<Setter Property="Margin" Value="5,0,5,0" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
</Style>
<Style x:Key="sysCombobox" TargetType="telerik:RadComboBox">
<Setter Property="Height" Value="24" />
<Setter Property="Margin" Value="5,5,5,0" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
</Style>
<!-- 树形下拉框样式 起始 -->
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.Static.Checked.Fill" Color="#FF595959" />
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.Static.Checked.Stroke" Color="#FF262626" />
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.MouseOver.Stroke" Color="#FF27C7F7" />
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.MouseOver.Fill" Color="#FFCCEEFB" />
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.MouseOver.Checked.Stroke" Color="#FF1CC4F7" />
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.MouseOver.Checked.Fill" Color="#FF82DFFB" />
<PathGeometry x:Key="TreeArrow">
M320 885.333333c-8.533333 0-17.066667-4.266667-23.466667-10.666666-12.8-12.8-10.666667-34.133333 2.133334-44.8L654.933333 512 298.666667 194.133333c-12.8-10.666667-14.933333-32
-2.133334-44.8 10.666667-12.8 32-14.933333 44.8-2.133333l384 341.333333c6.4 6.4 10.666667 14.933333 10.666667 23.466667 0 8.533333-4.266667 17.066667-10.666667 23.466667l-384
341.333333c-6.4 6.4-12.8 8.533333-21.333333 8.533333z
</PathGeometry>
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.Static.Fill" Color="#FF818181" />
<SolidColorBrush x:Key="TreeViewItem.TreeArrow.Static.Stroke" Color="#FF818181" />
<Style x:Key="ExpandCollapseToggleStyle" TargetType="{x:Type ToggleButton}">
<Setter Property="Focusable" Value="False" />
<Setter Property="Width" Value="16" />
<Setter Property="Height" Value="16" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Border
Width="14"
Height="14"
Padding="2"
Background="Transparent">
<Path
x:Name="ExpandPath"
Data="{StaticResource TreeArrow}"
Fill="{StaticResource TreeViewItem.TreeArrow.Static.Fill}"
RenderTransformOrigin="0.5,0.5"
Stretch="Uniform"
Stroke="{StaticResource TreeViewItem.TreeArrow.Static.Stroke}">
<Path.RenderTransform>
<RotateTransform Angle="0" />
</Path.RenderTransform>
</Path>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="ExpandPath" Property="RenderTransform">
<Setter.Value>
<RotateTransform Angle="90" />
</Setter.Value>
</Setter>
<Setter TargetName="ExpandPath" Property="Fill" Value="{StaticResource TreeViewItem.TreeArrow.Static.Checked.Fill}" />
<Setter TargetName="ExpandPath" Property="Stroke" Value="{StaticResource TreeViewItem.TreeArrow.Static.Checked.Stroke}" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="ExpandPath" Property="Stroke" Value="{StaticResource TreeViewItem.TreeArrow.MouseOver.Stroke}" />
<Setter TargetName="ExpandPath" Property="Fill" Value="{StaticResource TreeViewItem.TreeArrow.MouseOver.Fill}" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsChecked" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="ExpandPath" Property="Stroke" Value="{StaticResource TreeViewItem.TreeArrow.MouseOver.Checked.Stroke}" />
<Setter TargetName="ExpandPath" Property="Fill" Value="{StaticResource TreeViewItem.TreeArrow.MouseOver.Checked.Fill}" />
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TreeViewItemStyle1" TargetType="{x:Type TreeViewItem}">
<Setter Property="Background" Value="Transparent" />
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
<Setter Property="Padding" Value="2,2,0,2" />
<Setter Property="FontFamily" Value="微软雅黑" />
<Setter Property="FontSize" Value="13" />
<Setter Property="IsExpanded" Value="True" />
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
<Setter Property="FocusVisualStyle">
<Setter.Value>
<Style>
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TreeViewItem}">
<Grid Grid.IsSharedSizeScope="True">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid x:Name="GridTop">
<Grid.ColumnDefinitions>
<ColumnDefinition
Width="Auto"
MinWidth="19"
SharedSizeGroup="Icon" />
<ColumnDefinition Width="Auto" SharedSizeGroup="Header" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border
x:Name="Bd"
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="3"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="true" />
<ToggleButton
x:Name="Expander"
Grid.Row="0"
Grid.Column="0"
Margin="{TemplateBinding BorderThickness}"
ClickMode="Press"
IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}"
Style="{StaticResource ExpandCollapseToggleStyle}" />
<ContentPresenter
x:Name="PART_Header"
Grid.Column="1"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
ContentSource="Header"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Grid>
<Grid x:Name="GridBottom" Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition
Width="Auto"
MinWidth="19"
SharedSizeGroup="Icon" />
<ColumnDefinition Width="Auto" SharedSizeGroup="Header" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<ItemsPresenter
x:Name="ItemsHost"
Grid.Row="1"
Grid.Column="1"
Grid.ColumnSpan="2" />
</Grid>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="false">
<Setter TargetName="ItemsHost" Property="Visibility" Value="Collapsed" />
</Trigger>
<Trigger Property="HasItems" Value="false">
<Setter TargetName="Expander" Property="Visibility" Value="Hidden" />
</Trigger>
<Trigger SourceName="GridTop" Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#80D6EBFF" />
</Trigger>
<Trigger Property="IsSelected" Value="true">
<Setter TargetName="Bd" Property="BorderBrush" Value="blue" />
<Setter TargetName="Bd" Property="BorderThickness" Value="0" />
<Setter TargetName="Bd" Property="Background" Value="#80A9D6FF" />
<Setter TargetName="PART_Header" Property="TextBlock.FontWeight" Value="Bold" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="true" />
<Condition Property="IsSelectionActive" Value="false" />
</MultiTrigger.Conditions>
<Setter TargetName="Bd" Property="Background" Value="#8090E8FB" />
<Setter Property="Foreground" Value="black" />
</MultiTrigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="VirtualizingPanel.IsVirtualizing" Value="true">
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<VirtualizingStackPanel />
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="sysTreeCombobox" TargetType="local:TreeComboBox">
<Setter Property="Height" Value="24" />
<Setter Property="Margin" Value="5,5,5,0" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
</Style>
<!-- 树形下拉框样式 结束 -->
<!-- 透明下拉框 -->
<!-- 透明背景 Combox Start -->
<!-- Combox TransparentComboBoxStyle -->
<Style x:Key="ComboBoxItemStyle" TargetType="ComboBoxItem">
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Height" Value="25" />
<Setter Property="Foreground" Value="Black" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBoxItem">
<Border
Name="Back"
Background="Transparent"
BorderBrush="#FF6A6A6A"
BorderThickness="0,0,0,0">
<ContentPresenter
Margin="{TemplateBinding Padding}"
HorizontalAlignment="Left"
VerticalAlignment="Center"
ContentSource="{Binding Source}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsHighlighted" Value="True">
<Setter TargetName="Back" Property="Background" Value="Pink" />
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Back" Property="Background" Value="#FFCBE3FE" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ToggleButton样式折叠展开按钮 -->
<Style x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="IsTabStop" Value="false" />
<Setter Property="Focusable" Value="false" />
<Setter Property="ClickMode" Value="Press" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Border
x:Name="templateRoot"
Background="Transparent"
BorderBrush="Black"
BorderThickness="1"
CornerRadius="0"
SnapsToDevicePixels="true">
<Border
x:Name="splitBorder"
Width="30"
Margin="0"
HorizontalAlignment="Right"
Background="Transparent"
BorderBrush="Black"
BorderThickness="0"
CornerRadius="0"
SnapsToDevicePixels="true">
<Path
x:Name="arrow"
Width="10"
Height="6"
VerticalAlignment="Center"
Data="M5,0 L10,10 L0,10 z"
Fill="#03ffea"
RenderTransformOrigin="0.5,0.5"
Stretch="Fill"
StrokeThickness="0">
<Path.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform Angle="180" />
<TranslateTransform />
</TransformGroup>
</Path.RenderTransform>
</Path>
</Border>
</Border>
<ControlTemplate.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true" />
<Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="false" />
<Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="false" />
<Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="true" />
</MultiDataTrigger.Conditions>
<Setter TargetName="templateRoot" Property="BorderBrush" Value="black" />
</MultiDataTrigger>
<Trigger Property="IsEnabled" Value="false">
<Setter TargetName="arrow" Property="Fill" Value="#FFADADAD" />
<Setter TargetName="templateRoot" Property="BorderBrush" Value="#FFADADAD" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ComboBox Template样式 -->
<ControlTemplate x:Key="ComboBoxTemplate" TargetType="{x:Type ComboBox}">
<Grid x:Name="templateRoot" SnapsToDevicePixels="true">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="0" />
</Grid.ColumnDefinitions>
<Popup
x:Name="PART_Popup"
Grid.ColumnSpan="2"
Margin="1"
AllowsTransparency="true"
IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
Placement="Bottom"
PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
<Border
x:Name="dropDownBorder"
MinWidth="{Binding ActualWidth, ElementName=templateRoot}"
MaxHeight="{TemplateBinding MaxDropDownHeight}"
Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}"
BorderThickness="1">
<ScrollViewer x:Name="DropDownScrollViewer">
<Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
<Canvas
x:Name="canvas"
Width="0"
Height="0"
HorizontalAlignment="Left"
VerticalAlignment="Top">
<Rectangle
x:Name="opaqueRect"
Width="{Binding ActualWidth, ElementName=dropDownBorder}"
Height="{Binding ActualHeight, ElementName=dropDownBorder}"
Fill="{Binding Background, ElementName=dropDownBorder}" />
</Canvas>
<StackPanel
Background="#FFFFFFFF"
IsItemsHost="True"
KeyboardNavigation.DirectionalNavigation="Continue" />
<!--<ItemsPresenter x:Name="ItemsPresenter" KeyboardNavigation.DirectionalNavigation="Contained" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>-->
</Grid>
</ScrollViewer>
</Border>
</Popup>
<Border
Grid.ColumnSpan="2"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="0">
<Grid>
<ToggleButton
x:Name="toggleButton"
Grid.ColumnSpan="2"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="0"
Foreground="White"
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
Style="{StaticResource ComboBoxToggleButton}" />
<ContentPresenter
x:Name="contentPresenter"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding SelectionBoxItem}"
ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
IsHitTestVisible="false"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Grid>
</Border>
</Grid>
<ControlTemplate.Triggers>
<!--<Trigger Property="HasDropShadow" SourceName="PART_Popup" Value="true">
<Setter Property="Margin" TargetName="shadow" Value="0,0,5,5"/>
<Setter Property="Color" TargetName="shadow" Value="#71000000"/>
</Trigger>-->
<Trigger Property="HasItems" Value="false">
<Setter TargetName="dropDownBorder" Property="Height" Value="95" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsGrouping" Value="true" />
<Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false" />
</MultiTrigger.Conditions>
<Setter Property="ScrollViewer.CanContentScroll" Value="false" />
</MultiTrigger>
<Trigger SourceName="DropDownScrollViewer" Property="ScrollViewer.CanContentScroll" Value="false">
<Setter TargetName="opaqueRect" Property="Canvas.Top" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}" />
<Setter TargetName="opaqueRect" Property="Canvas.Left" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<!-- ComboBox属性设置 -->
<Style x:Key="TransparentComboBoxStyle" TargetType="{x:Type ComboBox}">
<Setter Property="BorderBrush" Value="#FFE4E7EC" />
<Setter Property="Foreground" Value="White" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="Padding" Value="6,3,5,3" />
<Setter Property="ScrollViewer.CanContentScroll" Value="true" />
<Setter Property="ScrollViewer.PanningMode" Value="Both" />
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="ItemContainerStyle" Value="{DynamicResource ComboBoxItemStyle}" />
<Setter Property="Template" Value="{StaticResource ComboBoxTemplate}" />
</Style>
<!-- 透明背景 Combox End -->
<!-- 多选 Combox Start -->
<ExponentialEase x:Key="ExponentialEaseOut" EasingMode="EaseOut" />
<DropShadowEffect
x:Key="PopupShadowDepth"
BlurRadius="12"
Opacity="0.1"
ShadowDepth="2"
Color="Transparent" />
<Geometry x:Key="ChevronDownGeometry" po:Freeze="True">M998 352c0 -8 -4 -17 -10 -23l-50 -50c-6 -6 -14 -10 -23 -10c-8 0 -17 4 -23 10l-393 393l-393 -393c-6 -6 -15 -10 -23 -10s-17 4 -23 10l-50 50c-6 6 -10 15 -10 23s4 17 10 23l466 466c6 6 15 10 23 10s17 -4 23 -10l466 -466c6 -6 10 -15 10 -23z</Geometry>
<ControlTemplate x:Key="ComboBoxTextBox" TargetType="{x:Type TextBox}">
<Border
HorizontalAlignment="Left"
Background="{TemplateBinding Background}"
Focusable="False">
<ScrollViewer
x:Name="PART_ContentHost"
Background="Transparent"
Focusable="False"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Hidden" />
</Border>
</ControlTemplate>
<ControlTemplate x:Key="ComboBoxToggleButton1" TargetType="{x:Type ToggleButton}">
<Border
x:Name="PART_Border"
Padding="1,1.2"
BorderThickness="0"
SnapsToDevicePixels="true">
<Grid Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition Width="30" />
</Grid.ColumnDefinitions>
<Rectangle
Grid.Column="1"
Width="30"
Height="Auto"
Margin="0,1"
Fill="Transparent" />
<Path
x:Name="PART_Arrow"
Grid.Column="1"
Width="10"
Height="6"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="M5,0 L10,10 L0,10 z"
Fill="#03ffea"
RenderTransformOrigin=".5,.5"
Stretch="Fill">
<Path.RenderTransform>
<RotateTransform Angle="180" />
</Path.RenderTransform>
</Path>
</Grid>
</Border>
</ControlTemplate>
<Style x:Key="DefaultMultiSelectComboBoxItem" TargetType="{x:Type local:MultiSelectComboBoxItem}">
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Foreground" Value="{DynamicResource RegularTextSolidColorBrush}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Height" Value="34" />
<Setter Property="Margin" Value="1,0" />
<Setter Property="Padding" Value="6,0" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:MultiSelectComboBoxItem}">
<Border
x:Name="PART_Border"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="true">
<CheckBox
Padding="{TemplateBinding Padding}"
HorizontalAlignment="Stretch"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Foreground="{TemplateBinding Foreground}"
IsChecked="{Binding IsSelected, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}">
<ContentPresenter
x:Name="PART_ContentPresenter"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
TextElement.Foreground="{TemplateBinding Foreground}" />
</CheckBox>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource DefaultBackgroundSolidColorBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type local:MultiSelectComboBox}">
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.CanContentScroll" Value="True" />
<Setter Property="SelectionMode" Value="Multiple" />
<Setter Property="MinWidth" Value="120" />
<Setter Property="Height" Value="25" />
<Setter Property="ItemContainerStyle" Value="{StaticResource DefaultMultiSelectComboBoxItem}" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="BorderBrush" Value="{DynamicResource BaseSolidColorBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Background" Value="{DynamicResource BackgroundSolidColorBrush}" />
<Setter Property="Padding" Value="14.5,3,30,3" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:MultiSelectComboBox}">
<ControlTemplate.Resources>
<Storyboard x:Key="OpenStoryboard">
<DoubleAnimation
EasingFunction="{StaticResource ExponentialEaseOut}"
Storyboard.TargetName="PART_DropDown"
Storyboard.TargetProperty="(Grid.RenderTransform).(ScaleTransform.ScaleY)"
To="1"
Duration="00:00:.2" />
</Storyboard>
<Storyboard x:Key="CloseStoryboard">
<DoubleAnimation
EasingFunction="{StaticResource ExponentialEaseOut}"
Storyboard.TargetName="PART_DropDown"
Storyboard.TargetProperty="(Grid.RenderTransform).(ScaleTransform.ScaleY)"
To="0"
Duration="00:00:.2" />
</Storyboard>
</ControlTemplate.Resources>
<local:SmallPanel SnapsToDevicePixels="True">
<Border
Name="PART_Border"
Background="Transparent"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{Binding Path=(local:ElementHelper.CornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
SnapsToDevicePixels="True" />
<ToggleButton
x:Name="PART_ToggleButton"
ClickMode="Release"
Focusable="False"
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
Style="{x:Null}"
Template="{StaticResource ComboBoxToggleButton1}" />
<TextBox
Name="PART_EditableTextBox"
Width="100"
Margin="2"
Padding="0"
HorizontalAlignment="Left"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalContentAlignment="Left"
Background="Transparent"
Focusable="True"
Foreground="White"
IsReadOnly="True"
SelectionBrush="{DynamicResource WindowBorderBrushSolidColorBrush}"
Style="{x:Null}"
Template="{StaticResource ComboBoxTextBox}"
Text="{Binding Text, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" />
<Popup
x:Name="PART_Popup"
AllowsTransparency="True"
IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
Placement="Bottom"
PlacementTarget="{Binding ElementName=PART_ToggleButton}"
StaysOpen="False">
<local:SmallPanel
x:Name="PART_DropDown"
MinWidth="{TemplateBinding FrameworkElement.ActualWidth}"
MaxHeight="{TemplateBinding MaxDropDownHeight}"
Margin="24,2,24,24"
RenderTransformOrigin=".5,0"
SnapsToDevicePixels="True">
<local:SmallPanel.RenderTransform>
<ScaleTransform ScaleY="0" />
</local:SmallPanel.RenderTransform>
<Border
Name="PART_DropDownBorder"
Background="Gray"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{Binding Path=(local:ElementHelper.CornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
Effect="{StaticResource PopupShadowDepth}"
SnapsToDevicePixels="True"
UseLayoutRounding="True" />
<Grid Margin="0,8" ClipToBounds="False">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<local:MultiSelectComboBoxItem
x:Name="PART_CheckBoxAll"
Content="{TemplateBinding SelectAllContent}"
Style="{TemplateBinding ItemContainerStyle}"
Visibility="{TemplateBinding IsSelectAllActive}" />
<ScrollViewer
x:Name="DropDownScrollViewer"
Grid.Row="1"
ScrollViewer.VerticalScrollBarVisibility="Auto">
<ItemsPresenter
x:Name="ItemsPresenter"
KeyboardNavigation.DirectionalNavigation="Contained"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</ScrollViewer>
</Grid>
</local:SmallPanel>
</Popup>
</local:SmallPanel>
<ControlTemplate.Triggers>
<Trigger SourceName="PART_ToggleButton" Property="IsChecked" Value="True">
<Trigger.EnterActions>
<BeginStoryboard x:Name="BeginStoryboardOpenStoryboard" Storyboard="{StaticResource OpenStoryboard}" />
</Trigger.EnterActions>
<Trigger.ExitActions>
<StopStoryboard BeginStoryboardName="BeginStoryboardOpenStoryboard" />
</Trigger.ExitActions>
</Trigger>
<Trigger SourceName="PART_ToggleButton" Property="IsChecked" Value="False">
<Trigger.EnterActions>
<BeginStoryboard x:Name="BeginStoryboardCloseStoryboard" Storyboard="{StaticResource CloseStoryboard}" />
</Trigger.EnterActions>
<Trigger.ExitActions>
<StopStoryboard BeginStoryboardName="BeginStoryboardCloseStoryboard" />
</Trigger.ExitActions>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="PART_Border" Property="BorderBrush" Value="{DynamicResource PrimaryNormalSolidColorBrush}" />
</Trigger>
<Trigger SourceName="PART_Popup" Property="AllowsTransparency" Value="True">
<Setter TargetName="PART_DropDownBorder" Property="Margin" Value="0,2,0,0" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 多选 Combox End -->
<!-- 多选搜索 Combox Start -->
<Color x:Key="PlaceholderTextColor" po:Freeze="True">#C0C4CC</Color>
<ControlTemplate x:Key="ComboBoxToggleButton2" TargetType="{x:Type ToggleButton}">
<Border
x:Name="PART_Border"
Padding="6,1.2"
Panel.ZIndex="2"
BorderThickness="0"
SnapsToDevicePixels="true">
<Grid Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="30" />
</Grid.ColumnDefinitions>
<Rectangle
Grid.Column="1"
Width="30"
Height="Auto"
Margin="0,1"
Fill="{TemplateBinding Background}" />
<Path
x:Name="PART_Arrow"
Grid.Column="1"
Width="10"
Height="6"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="{StaticResource ChevronDownGeometry}"
RenderTransformOrigin=".5,.5"
Stretch="Fill">
<Path.Fill>
<SolidColorBrush Color="{DynamicResource PlaceholderTextColor}" />
</Path.Fill>
<Path.RenderTransform>
<RotateTransform Angle="0" />
</Path.RenderTransform>
</Path>
</Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver" />
<VisualState x:Name="Pressed" />
<VisualState x:Name="Disabled" />
</VisualStateGroup>
<VisualStateGroup x:Name="CheckStates">
<VisualState x:Name="Checked">
<Storyboard>
<DoubleAnimation
EasingFunction="{StaticResource ExponentialEaseOut}"
Storyboard.TargetName="PART_Arrow"
Storyboard.TargetProperty="(Path.RenderTransform).(RotateTransform.Angle)"
To="-180"
Duration="00:00:.3" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unchecked">
<Storyboard>
<DoubleAnimation
EasingFunction="{StaticResource ExponentialEaseOut}"
Storyboard.TargetName="PART_Arrow"
Storyboard.TargetProperty="(Path.RenderTransform).(RotateTransform.Angle)"
To="0"
Duration="00:00:.3" />
</Storyboard>
</VisualState>
<VisualState x:Name="Indeterminate" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Border>
</ControlTemplate>
<Style x:Key="DefaultListBox" TargetType="{x:Type ListBox}">
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.CanContentScroll" Value="True" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBox}">
<Border
x:Name="Border"
Margin="{TemplateBinding Margin}"
Padding="0,0,0,.1"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{Binding Path=(local:ElementHelper.CornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
SnapsToDevicePixels="True">
<ScrollViewer Clip="{Binding RelativeSource={RelativeSource AncestorType=local:WDBorder}, Path=ContentClip}" Focusable="False">
<VirtualizingStackPanel IsItemsHost="True" />
</ScrollViewer>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsGrouping" Value="True">
<Setter Property="ScrollViewer.CanContentScroll" Value="False" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type local:MultiSelectSearchComboBox}">
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.CanContentScroll" Value="True" />
<Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="BorderBrush" Value="{DynamicResource BaseSolidColorBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Background" Value="{DynamicResource BackgroundSolidColorBrush}" />
<Setter Property="Padding" Value="14.5,3,30,3" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:MultiSelectSearchComboBox}">
<ControlTemplate.Resources>
<Storyboard x:Key="OpenStoryboard">
<DoubleAnimation
EasingFunction="{StaticResource ExponentialEaseOut}"
Storyboard.TargetName="PART_DropDown"
Storyboard.TargetProperty="(Grid.RenderTransform).(ScaleTransform.ScaleY)"
To="1"
Duration="00:00:.2" />
</Storyboard>
<Storyboard x:Key="CloseStoryboard">
<DoubleAnimation
EasingFunction="{StaticResource ExponentialEaseOut}"
Storyboard.TargetName="PART_DropDown"
Storyboard.TargetProperty="(Grid.RenderTransform).(ScaleTransform.ScaleY)"
To="0"
Duration="00:00:.2" />
</Storyboard>
</ControlTemplate.Resources>
<Border
Name="PART_Border"
Width="{TemplateBinding Width}"
Height="{TemplateBinding Height}"
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
VerticalAlignment="{TemplateBinding VerticalAlignment}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{Binding Path=(local:ElementHelper.CornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
SnapsToDevicePixels="True">
<Grid Grid.IsSharedSizeScope="true">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" SharedSizeGroup="ComboBoxButton" />
</Grid.ColumnDefinitions>
<TextBox
Name="PART_EditableTextBox"
Padding="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Panel.ZIndex="1"
Background="Transparent"
Focusable="True"
Foreground="{DynamicResource PrimaryTextSolidColorBrush}"
IsReadOnly="True"
SelectionBrush="{DynamicResource WindowBorderBrushSolidColorBrush}"
Style="{x:Null}"
Template="{StaticResource ComboBoxTextBox}"
Text="{Binding Text, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}" />
<TextBlock
x:Name="PART_Watermark"
Padding="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Background="Transparent"
FontSize="{TemplateBinding FontSize}"
Foreground="{DynamicResource RegularTextSolidColorBrush}"
IsHitTestVisible="False"
Text="{Binding Path=(local:ElementHelper.Watermark), RelativeSource={RelativeSource TemplatedParent}}"
TextTrimming="CharacterEllipsis"
Visibility="Collapsed" />
<ToggleButton
x:Name="PART_ToggleButton"
Grid.ColumnSpan="2"
Panel.ZIndex="2"
Background="{TemplateBinding Background}"
ClickMode="Release"
Focusable="False"
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
Style="{x:Null}"
Template="{StaticResource ComboBoxToggleButton2}" />
<Popup
x:Name="PART_Popup"
AllowsTransparency="True"
IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
Placement="Bottom"
PlacementTarget="{Binding ElementName=PART_Border}"
StaysOpen="False">
<local:SmallPanel
x:Name="PART_DropDown"
MinWidth="{TemplateBinding FrameworkElement.ActualWidth}"
MaxHeight="{TemplateBinding MaxDropDownHeight}"
Margin="24,2,24,24"
RenderTransformOrigin=".5,0"
SnapsToDevicePixels="True">
<local:SmallPanel.RenderTransform>
<ScaleTransform ScaleY="0" />
</local:SmallPanel.RenderTransform>
<Border
Name="PART_DropDownBorder"
Background="White"
BorderBrush="Blue"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{Binding Path=(local:ElementHelper.CornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
Effect="{StaticResource PopupShadowDepth}"
SnapsToDevicePixels="True"
UseLayoutRounding="True" />
<Grid Margin="0,8" ClipToBounds="False">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition />
</Grid.RowDefinitions>
<TextBox
x:Name="PART_TextBox"
Height="{Binding ElementName=PART_EditableTextBox, Path=Height}"
Margin="6,0"
local:ElementHelper.CornerRadius="{Binding Path=(local:ElementHelper.CornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
local:ElementHelper.IsClear="True"
local:ElementHelper.Watermark="{Binding SearchWatermark, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
FontSize="{Binding ElementName=PART_EditableTextBox, Path=FontSize}" />
<CheckBox
x:Name="PART_SelectAll"
Grid.Row="1"
Margin="4"
local:ElementHelper.CornerRadius="{Binding Path=(local:ElementHelper.CornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
Content="{TemplateBinding SelectAllContent}"
Visibility="{TemplateBinding IsSelectAllActive}" />
<local:MultiSelectListBox
x:Name="PART_Selector"
Grid.Row="2"
Margin="1,0"
Padding="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
local:ElementHelper.CornerRadius="{Binding Path=(local:ElementHelper.CornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="0"
DisplayMemberPath="{TemplateBinding DisplayMemberPath}"
ItemContainerStyle="{StaticResource DefaultMultiSelectComboBoxItem}"
ItemsSource="{TemplateBinding ItemsSource}"
ScrollViewer.CanContentScroll="{Binding ScrollViewer.CanContentScroll, RelativeSource={RelativeSource TemplatedParent}}"
ScrollViewer.HorizontalScrollBarVisibility="{Binding ScrollViewer.HorizontalScrollBarVisibility, RelativeSource={RelativeSource TemplatedParent}}"
SelectedValuePath="{TemplateBinding SelectedValuePath}"
SelectionMode="Multiple"
Style="{StaticResource DefaultListBox}" />
<local:MultiSelectListBox
x:Name="PART_SearchSelector"
Grid.Row="2"
Margin="1,0"
Padding="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
local:ElementHelper.CornerRadius="{Binding Path=(local:ElementHelper.CornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="0"
DisplayMemberPath="{TemplateBinding DisplayMemberPath}"
ItemContainerStyle="{StaticResource DefaultMultiSelectComboBoxItem}"
ItemsSource="{TemplateBinding ItemsSourceSearch}"
ScrollViewer.CanContentScroll="{Binding ScrollViewer.CanContentScroll, RelativeSource={RelativeSource TemplatedParent}}"
ScrollViewer.HorizontalScrollBarVisibility="{Binding ScrollViewer.HorizontalScrollBarVisibility, RelativeSource={RelativeSource TemplatedParent}}"
SelectedValuePath="{TemplateBinding SelectedValuePath}"
SelectionMode="Multiple"
Style="{StaticResource DefaultListBox}"
Visibility="Collapsed" />
</Grid>
</local:SmallPanel>
</Popup>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger SourceName="PART_ToggleButton" Property="IsChecked" Value="True">
<Trigger.EnterActions>
<BeginStoryboard x:Name="BeginStoryboardOpenStoryboard" Storyboard="{StaticResource OpenStoryboard}" />
</Trigger.EnterActions>
<Trigger.ExitActions>
<StopStoryboard BeginStoryboardName="BeginStoryboardOpenStoryboard" />
</Trigger.ExitActions>
</Trigger>
<Trigger SourceName="PART_ToggleButton" Property="IsChecked" Value="False">
<Trigger.EnterActions>
<BeginStoryboard x:Name="BeginStoryboardCloseStoryboard" Storyboard="{StaticResource CloseStoryboard}" />
</Trigger.EnterActions>
<Trigger.ExitActions>
<StopStoryboard BeginStoryboardName="BeginStoryboardCloseStoryboard" />
</Trigger.ExitActions>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="PART_Border" Property="BorderBrush" Value="{DynamicResource PrimaryNormalSolidColorBrush}" />
</Trigger>
<Trigger SourceName="PART_Popup" Property="AllowsTransparency" Value="True">
<Setter TargetName="PART_DropDownBorder" Property="Margin" Value="0,2,0,0" />
</Trigger>
<Trigger Property="Text" Value="">
<Setter TargetName="PART_Watermark" Property="Visibility" Value="Visible" />
</Trigger>
<Trigger Property="Text" Value="{x:Null}">
<Setter TargetName="PART_Watermark" Property="Visibility" Value="Visible" />
</Trigger>
<Trigger Property="IsSelectAllActive" Value="False">
<Setter TargetName="PART_TextBox" Property="Margin" Value="6,2" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 多选搜索 Combox End -->
<!-- 数字输入框 NumericBox Start -->
<Style x:Key="MiniPathIcon" TargetType="{x:Type local:PathIcon}">
<Setter Property="Height" Value="10" />
<Setter Property="Width" Value="7" />
</Style>
<Style x:Key="DefaultRepeatButton" TargetType="{x:Type RepeatButton}">
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RepeatButton}">
<local:SmallPanel>
<Border
Name="PART_Border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{Binding Path=(local:ElementHelper.CornerRadius), RelativeSource={RelativeSource TemplatedParent}}" />
<ContentPresenter
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</local:SmallPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsPressed" Value="True">
<Setter Property="BorderBrush" Value="Black" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="DeepSkyBlue" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type local:NumericBox}">
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Disabled" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:NumericBox}">
<local:SmallPanel Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">
<Border
x:Name="PART_Border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{Binding Path=(local:ElementHelper.CornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox
x:Name="PART_TextBox"
MinHeight="{TemplateBinding MinHeight}"
Padding="{TemplateBinding Padding}"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
local:TextBoxHelper.IsEnterUpdateEnabled="True"
Background="{x:Null}"
BorderThickness="0"
FocusVisualStyle="{x:Null}"
Focusable="{TemplateBinding Focusable}"
FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
Foreground="{TemplateBinding Foreground}"
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
InputMethod.IsInputMethodEnabled="False"
IsReadOnly="{TemplateBinding IsReadOnly}"
IsTabStop="{TemplateBinding IsTabStop}"
SelectionBrush="DeepSkyBlue"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
Style="{x:Null}"
TabIndex="{TemplateBinding TabIndex}"
TextAlignment="{TemplateBinding TextAlignment}"
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" />
<Grid Grid.Column="1" Width="{TemplateBinding UpDownButtonsWidth}">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition Height="1" />
<RowDefinition />
</Grid.RowDefinitions>
<RepeatButton
x:Name="PART_NumericUp"
Grid.Row="0"
Margin="0,1,1,0"
Padding="0"
Command="{x:Static local:NumericBox.IncreaseCommand}"
Delay="{TemplateBinding Delay}"
IsTabStop="False"
Style="{StaticResource DefaultRepeatButton}">
<local:PathIcon Kind="ChevronUp" Style="{StaticResource MiniPathIcon}" />
</RepeatButton>
<RepeatButton
x:Name="PART_NumericDown"
Grid.Row="2"
Margin="0,0,1,1"
Padding="0"
Command="{x:Static local:NumericBox.DecreaseCommand}"
Delay="{TemplateBinding Delay}"
IsTabStop="False"
Style="{StaticResource DefaultRepeatButton}">
<local:PathIcon Kind="ChevronDown" Style="{StaticResource MiniPathIcon}" />
</RepeatButton>
</Grid>
</Grid>
</Border>
</local:SmallPanel>
<ControlTemplate.Triggers>
<Trigger Property="UpDownButtonsWidth" Value="0">
<Setter TargetName="PART_NumericDown" Property="Visibility" Value="Collapsed" />
<Setter TargetName="PART_NumericUp" Property="Visibility" Value="Collapsed" />
</Trigger>
<Trigger Property="IsReadOnly" Value="True">
<Setter Property="Focusable" Value="False" />
<Setter TargetName="PART_NumericDown" Property="IsEnabled" Value="False" />
<Setter TargetName="PART_NumericUp" Property="IsEnabled" Value="False" />
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="Black" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 数字输入框 NumericBox End -->
<Style x:Key="ComboBoxStyle" TargetType="ComboBox">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBox">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.7*" />
<ColumnDefinition Width="0.3*" MaxWidth="29" />
</Grid.ColumnDefinitions>
<!-- 文字区域背景和边线样式 -->
<TextBox
Grid.Column="0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
VerticalContentAlignment="Center"
Background="Transparent"
BorderBrush="Black"
BorderThickness="0"
Foreground="White"
IsReadOnly="{TemplateBinding IsReadOnly}"
Text="{TemplateBinding Text}" />
<Border
Grid.Column="0"
BorderBrush="Black"
BorderThickness="0,1,0,0"
CornerRadius="1,0,0,1" />
<!-- 右侧下拉按钮设置 -->
<Border
Grid.Column="1"
BorderBrush="Black"
BorderThickness="0"
CornerRadius="0">
<ToggleButton
BorderBrush="#03ffea"
BorderThickness="1"
ClickMode="Press"
IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
Style="{StaticResource ComboBoxToggleButton}" />
</Border>
<!-- 弹出popup整体设置 -->
<Popup
x:Name="Popup"
AllowsTransparency="True"
Focusable="False"
IsOpen="{TemplateBinding IsDropDownOpen}"
Placement="Bottom"
PopupAnimation="Slide">
<Border
x:Name="DropDown"
MinWidth="{TemplateBinding ActualWidth}"
MaxHeight="{TemplateBinding MaxDropDownHeight}"
BorderBrush="Black"
BorderThickness="1,0,1,1"
CornerRadius="1"
SnapsToDevicePixels="True">
<Border.Effect>
<DropShadowEffect
BlurRadius="2"
Opacity="1"
ShadowDepth="0"
Color="Black" />
</Border.Effect>
<ScrollViewer
Margin="0,0,0,0"
BorderBrush="Black"
BorderThickness="1"
HorizontalScrollBarVisibility="Auto"
SnapsToDevicePixels="True"
VerticalScrollBarVisibility="Auto">
<StackPanel
Background="#FF6A6A6A"
IsItemsHost="True"
KeyboardNavigation.DirectionalNavigation="Contained" />
</ScrollViewer>
</Border>
</Popup>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 图标按钮 -->
<Style TargetType="{x:Type local:IconButton}">
<Setter Property="Padding" Value="5" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:IconButton}">
<Grid>
<!-- 背景层 -->
<Border
x:Name="border"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="3" />
<DockPanel>
<!-- 图标层 -->
<Path
x:Name="PART_Icon"
Width="{TemplateBinding IconSize}"
Height="{TemplateBinding IconSize}"
Margin="{TemplateBinding IconMargin}"
Data="{TemplateBinding IconData}"
DockPanel.Dock="{TemplateBinding IconPlacement}"
Fill="{TemplateBinding Foreground}"
Stretch="Uniform" />
<!-- 内容层 -->
<ContentPresenter
x:Name="PART_Content"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
RecognizesAccessKey="True" />
</DockPanel>
</Grid>
<ControlTemplate.Triggers>
<!-- 按钮禁用 -->
2025-08-15 16:34:31 +08:00
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="PART_Icon" Property="Fill" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" />
2025-08-15 16:34:31 +08:00
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlLightBrushKey}}" />
</Trigger>
<!-- 按下效果 -->
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="border" Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlDarkBrushKey}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>