整理代码

This commit is contained in:
GG Z
2026-02-20 15:31:44 +08:00
parent 94cf3f3266
commit 9f121cfc7f
149 changed files with 4063 additions and 6964 deletions

View File

@@ -1,10 +1,10 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:assists="clr-namespace:Melskin.Assists"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:assists="clr-namespace:Melskin.Assists">
<!--#region 默认样式-->
<Style TargetType="{x:Type TabItem}" x:Key="FlattenTabItemStyle">
<Style x:Key="FlattenTabItemStyle" TargetType="{x:Type TabItem}">
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
<Setter Property="Padding" Value="12,10" />
<Setter Property="Margin" Value="0" />
@@ -13,16 +13,16 @@
<ControlTemplate TargetType="{x:Type TabItem}">
<!-- 默认是 Top/Bottom 的样式,下划线 -->
<Border
x:Name="Border"
Padding="{TemplateBinding Padding}"
Background="Transparent"
BorderBrush="Transparent"
BorderThickness="0,0,0,2"
Padding="{TemplateBinding Padding}"
x:Name="Border">
BorderThickness="0,0,0,2">
<ContentPresenter
ContentSource="Header"
x:Name="ContentSite"
HorizontalAlignment="Center"
VerticalAlignment="Center"
x:Name="ContentSite" />
ContentSource="Header" />
</Border>
<ControlTemplate.Triggers>
<!-- 鼠标悬停效果 -->
@@ -32,18 +32,18 @@
<!-- 选中效果 -->
<Trigger Property="IsSelected" Value="True">
<Setter Property="Foreground" Value="{DynamicResource PrimaryNormalBrush}" />
<Setter Property="BorderBrush" TargetName="Border" Value="{DynamicResource PrimaryNormalBrush}" />
<Setter TargetName="Border" Property="BorderBrush" Value="{DynamicResource PrimaryNormalBrush}" />
</Trigger>
<!-- 根据父级 TabControl 的 TabStripPlacement 动态调整下划线位置 -->
<DataTrigger Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom">
<Setter Property="BorderThickness" TargetName="Border" Value="0,2,0,0" />
<Setter TargetName="Border" Property="BorderThickness" Value="0,2,0,0" />
</DataTrigger>
<DataTrigger Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left">
<Setter Property="BorderThickness" TargetName="Border" Value="0,0,2,0" />
<Setter TargetName="Border" Property="BorderThickness" Value="0,0,2,0" />
</DataTrigger>
<DataTrigger Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right">
<Setter Property="BorderThickness" TargetName="Border" Value="2,0,0,0" />
<Setter TargetName="Border" Property="BorderThickness" Value="2,0,0,0" />
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
@@ -51,7 +51,7 @@
</Setter>
</Style>
<Style TargetType="{x:Type TabControl}" x:Key="FlattenTabControlStyle">
<Style x:Key="FlattenTabControlStyle" TargetType="{x:Type TabControl}">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="ItemContainerStyle" Value="{StaticResource FlattenTabItemStyle}" />
@@ -59,50 +59,50 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabControl}">
<DockPanel
x:Name="templateRoot"
KeyboardNavigation.TabNavigation="Local"
LastChildFill="True"
x:Name="templateRoot">
LastChildFill="True">
<!-- 标签头容器 (默认停靠在顶部) -->
<Border
x:Name="HeaderPanelBorder"
BorderBrush="{DynamicResource BorderNormalBrush}"
BorderThickness="0,0,0,1"
DockPanel.Dock="Top"
x:Name="HeaderPanelBorder">
DockPanel.Dock="Top">
<TabPanel
IsItemsHost="True"
x:Name="HeaderPanel"
Margin="0"
Panel.ZIndex="1"
x:Name="HeaderPanel" />
IsItemsHost="True" />
</Border>
<!-- 内容区域 (自动填充剩余空间) -->
<Border
x:Name="ContentPanelBorder"
Background="{TemplateBinding Background}"
BorderThickness="0"
x:Name="ContentPanelBorder">
BorderThickness="0">
<ContentPresenter
ContentSource="SelectedContent"
x:Name="PART_SelectedContentHost"
Margin="{TemplateBinding Padding}"
x:Name="PART_SelectedContentHost" />
ContentSource="SelectedContent" />
</Border>
</DockPanel>
<ControlTemplate.Triggers>
<!-- 当标签在底部时 -->
<Trigger Property="TabStripPlacement" Value="Bottom">
<Setter Property="DockPanel.Dock" TargetName="HeaderPanelBorder" Value="Bottom" />
<Setter Property="BorderThickness" TargetName="HeaderPanelBorder" Value="0,1,0,0" />
<Setter TargetName="HeaderPanelBorder" Property="DockPanel.Dock" Value="Bottom" />
<Setter TargetName="HeaderPanelBorder" Property="BorderThickness" Value="0,1,0,0" />
</Trigger>
<!-- 当标签在左侧时 -->
<Trigger Property="TabStripPlacement" Value="Left">
<Setter Property="DockPanel.Dock" TargetName="HeaderPanelBorder" Value="Left" />
<Setter Property="BorderThickness" TargetName="HeaderPanelBorder" Value="0,0,1,0" />
<Setter TargetName="HeaderPanelBorder" Property="DockPanel.Dock" Value="Left" />
<Setter TargetName="HeaderPanelBorder" Property="BorderThickness" Value="0,0,1,0" />
</Trigger>
<!-- 当标签在右侧时 -->
<Trigger Property="TabStripPlacement" Value="Right">
<Setter Property="DockPanel.Dock" TargetName="HeaderPanelBorder" Value="Right" />
<Setter Property="BorderThickness" TargetName="HeaderPanelBorder" Value="1,0,0,0" />
<Setter TargetName="HeaderPanelBorder" Property="DockPanel.Dock" Value="Right" />
<Setter TargetName="HeaderPanelBorder" Property="BorderThickness" Value="1,0,0,0" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
@@ -124,65 +124,65 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<Grid SnapsToDevicePixels="true" x:Name="templateRoot">
<Grid x:Name="templateRoot" SnapsToDevicePixels="true">
<Border
Background="{TemplateBinding Background}"
CornerRadius="4,4,0,0"
x:Name="mainBorder"
Margin="0,0,0,-1"
x:Name="mainBorder">
Background="{TemplateBinding Background}"
CornerRadius="4,4,0,0">
<ContentPresenter
x:Name="contentPresenter"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
ContentSource="Header"
Focusable="False"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="contentPresenter" />
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<!-- 标识 -->
<Border
Background="{TemplateBinding Background}"
HorizontalAlignment="Right"
Margin="-1,4"
Visibility="Collapsed"
x:Name="separate"
Width="1"
x:Name="separate" />
Margin="-1,4"
HorizontalAlignment="Right"
Background="{TemplateBinding Background}"
Visibility="Collapsed" />
</Grid>
<ControlTemplate.Triggers>
<!-- 靠左 -->
<DataTrigger Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left">
<Setter Property="CornerRadius" TargetName="mainBorder" Value="4,0,0,4" />
<Setter Property="Margin" TargetName="mainBorder" Value="0,0,-1,0" />
<Setter TargetName="mainBorder" Property="CornerRadius" Value="4,0,0,4" />
<Setter TargetName="mainBorder" Property="Margin" Value="0,0,-1,0" />
<!-- 分隔符方向 -->
<Setter Property="Width" TargetName="separate" Value="auto" />
<Setter Property="Height" TargetName="separate" Value="1" />
<Setter Property="Margin" TargetName="separate" Value="4,-1" />
<Setter Property="HorizontalAlignment" TargetName="separate" Value="Stretch" />
<Setter Property="VerticalAlignment" TargetName="separate" Value="Bottom" />
<Setter TargetName="separate" Property="Width" Value="auto" />
<Setter TargetName="separate" Property="Height" Value="1" />
<Setter TargetName="separate" Property="Margin" Value="4,-1" />
<Setter TargetName="separate" Property="HorizontalAlignment" Value="Stretch" />
<Setter TargetName="separate" Property="VerticalAlignment" Value="Bottom" />
</DataTrigger>
<!-- 靠右 -->
<DataTrigger Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right">
<Setter Property="CornerRadius" TargetName="mainBorder" Value="0,4,4,0" />
<Setter Property="Margin" TargetName="mainBorder" Value="-1,0,0,0" />
<Setter TargetName="mainBorder" Property="CornerRadius" Value="0,4,4,0" />
<Setter TargetName="mainBorder" Property="Margin" Value="-1,0,0,0" />
<!-- 分隔符方向 -->
<Setter Property="Width" TargetName="separate" Value="auto" />
<Setter Property="Height" TargetName="separate" Value="1" />
<Setter Property="Margin" TargetName="separate" Value="4,-1" />
<Setter Property="HorizontalAlignment" TargetName="separate" Value="Stretch" />
<Setter Property="VerticalAlignment" TargetName="separate" Value="Bottom" />
<Setter TargetName="separate" Property="Width" Value="auto" />
<Setter TargetName="separate" Property="Height" Value="1" />
<Setter TargetName="separate" Property="Margin" Value="4,-1" />
<Setter TargetName="separate" Property="HorizontalAlignment" Value="Stretch" />
<Setter TargetName="separate" Property="VerticalAlignment" Value="Bottom" />
</DataTrigger>
<!-- 下方 -->
<DataTrigger Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom">
<Setter Property="CornerRadius" TargetName="mainBorder" Value="0,0,4,4" />
<Setter Property="Margin" TargetName="mainBorder" Value="0,-1,0,0" />
<Setter TargetName="mainBorder" Property="CornerRadius" Value="0,0,4,4" />
<Setter TargetName="mainBorder" Property="Margin" Value="0,-1,0,0" />
</DataTrigger>
<!-- 未选中状态 -->
<Trigger Property="IsSelected" Value="False">
<Setter Property="Background" TargetName="mainBorder" Value="Transparent" />
<Setter Property="Visibility" TargetName="separate" Value="Visible" />
<Setter TargetName="mainBorder" Property="Background" Value="Transparent" />
<Setter TargetName="separate" Property="Visibility" Value="Visible" />
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
<!--<Setter Property="Panel.ZIndex" Value="1"/>-->
</Trigger>
@@ -192,11 +192,11 @@
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsSelected" Value="False" />
</MultiTrigger.Conditions>
<Setter Property="Background" TargetName="mainBorder" Value="{DynamicResource ControlBackgroundSelectedBrush}" />
<Setter TargetName="mainBorder" Property="Background" Value="{DynamicResource ControlBackgroundSelectedBrush}" />
</MultiTrigger>
<!-- 禁用状态 -->
<Trigger Property="IsEnabled" Value="False">
<Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="{DynamicResource TextDisabledBrush}" />
<Setter TargetName="templateRoot" Property="TextElement.Foreground" Value="{DynamicResource TextDisabledBrush}" />
</Trigger>
</ControlTemplate.Triggers>
@@ -220,86 +220,86 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabControl}">
<Grid
x:Name="templateRoot"
ClipToBounds="true"
KeyboardNavigation.TabNavigation="Local"
SnapsToDevicePixels="true"
x:Name="templateRoot">
SnapsToDevicePixels="true">
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="ColumnDefinition0" />
<ColumnDefinition Width="0" x:Name="ColumnDefinition1" />
<ColumnDefinition x:Name="ColumnDefinition1" Width="0" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" x:Name="RowDefinition0" />
<RowDefinition Height="*" x:Name="RowDefinition1" />
<RowDefinition x:Name="RowDefinition0" Height="Auto" />
<RowDefinition x:Name="RowDefinition1" Height="*" />
</Grid.RowDefinitions>
<TabPanel
Background="Transparent"
Grid.Column="0"
x:Name="headerPanel"
Grid.Row="0"
IsItemsHost="true"
KeyboardNavigation.TabIndex="1"
Grid.Column="0"
Panel.ZIndex="1"
x:Name="headerPanel" />
Background="Transparent"
IsItemsHost="true"
KeyboardNavigation.TabIndex="1" />
<Border
x:Name="contentPanel"
Grid.Row="1"
Grid.Column="0"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="0,0,4,4"
Grid.Column="0"
Grid.Row="1"
KeyboardNavigation.DirectionalNavigation="Contained"
KeyboardNavigation.TabIndex="2"
KeyboardNavigation.TabNavigation="Local"
x:Name="contentPanel">
KeyboardNavigation.TabNavigation="Local">
<ContentPresenter
ContentSource="SelectedContent"
x:Name="PART_SelectedContentHost"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
x:Name="PART_SelectedContentHost" />
ContentSource="SelectedContent"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="TabStripPlacement" Value="Bottom">
<!-- 设置布局 -->
<Setter Property="Grid.Row" TargetName="headerPanel" Value="1" />
<Setter Property="Grid.Row" TargetName="contentPanel" Value="0" />
<Setter Property="Height" TargetName="RowDefinition0" Value="*" />
<Setter Property="Height" TargetName="RowDefinition1" Value="Auto" />
<Setter TargetName="headerPanel" Property="Grid.Row" Value="1" />
<Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="RowDefinition0" Property="Height" Value="*" />
<Setter TargetName="RowDefinition1" Property="Height" Value="Auto" />
<!-- 设置边框 -->
<Setter Property="BorderThickness" Value="1,1,1,3" />
<Setter Property="CornerRadius" TargetName="contentPanel" Value="4,4,0,0" />
<Setter TargetName="contentPanel" Property="CornerRadius" Value="4,4,0,0" />
</Trigger>
<Trigger Property="TabStripPlacement" Value="Left">
<!-- 设置布局 -->
<Setter Property="Grid.Row" TargetName="headerPanel" Value="0" />
<Setter Property="Grid.Row" TargetName="contentPanel" Value="0" />
<Setter Property="Grid.Column" TargetName="headerPanel" Value="0" />
<Setter Property="Grid.Column" TargetName="contentPanel" Value="1" />
<Setter Property="Width" TargetName="ColumnDefinition0" Value="Auto" />
<Setter Property="Width" TargetName="ColumnDefinition1" Value="*" />
<Setter Property="Height" TargetName="RowDefinition0" Value="*" />
<Setter Property="Height" TargetName="RowDefinition1" Value="0" />
<Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="headerPanel" Property="Grid.Column" Value="0" />
<Setter TargetName="contentPanel" Property="Grid.Column" Value="1" />
<Setter TargetName="ColumnDefinition0" Property="Width" Value="Auto" />
<Setter TargetName="ColumnDefinition1" Property="Width" Value="*" />
<Setter TargetName="RowDefinition0" Property="Height" Value="*" />
<Setter TargetName="RowDefinition1" Property="Height" Value="0" />
<!-- 设置边框 -->
<Setter Property="BorderThickness" Value="3,1,1,1" />
<Setter Property="CornerRadius" TargetName="contentPanel" Value="0,4,4,0" />
<Setter TargetName="contentPanel" Property="CornerRadius" Value="0,4,4,0" />
</Trigger>
<Trigger Property="TabStripPlacement" Value="Right">
<!-- 设置布局 -->
<Setter Property="Grid.Row" TargetName="headerPanel" Value="0" />
<Setter Property="Grid.Row" TargetName="contentPanel" Value="0" />
<Setter Property="Grid.Column" TargetName="headerPanel" Value="1" />
<Setter Property="Grid.Column" TargetName="contentPanel" Value="0" />
<Setter Property="Width" TargetName="ColumnDefinition0" Value="*" />
<Setter Property="Width" TargetName="ColumnDefinition1" Value="Auto" />
<Setter Property="Height" TargetName="RowDefinition0" Value="*" />
<Setter Property="Height" TargetName="RowDefinition1" Value="0" />
<Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="headerPanel" Property="Grid.Column" Value="1" />
<Setter TargetName="contentPanel" Property="Grid.Column" Value="0" />
<Setter TargetName="ColumnDefinition0" Property="Width" Value="*" />
<Setter TargetName="ColumnDefinition1" Property="Width" Value="Auto" />
<Setter TargetName="RowDefinition0" Property="Height" Value="*" />
<Setter TargetName="RowDefinition1" Property="Height" Value="0" />
<!-- 设置边框 -->
<Setter Property="BorderThickness" Value="1,1,3,1" />
<Setter Property="CornerRadius" TargetName="contentPanel" Value="4,0,0,4" />
<Setter TargetName="contentPanel" Property="CornerRadius" Value="4,0,0,4" />
</Trigger>
<!-- 禁用效果 -->
<Trigger Property="IsEnabled" Value="false">
<Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="{DynamicResource TextDisabledBrush}" />
<Setter TargetName="templateRoot" Property="TextElement.Foreground" Value="{DynamicResource TextDisabledBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
@@ -308,7 +308,7 @@
</Style>
<!-- 浮动Tab样式 -->
<Style TargetType="{x:Type TabItem}" x:Key="NavigationTabItemStyle">
<Style x:Key="NavigationTabItemStyle" TargetType="{x:Type TabItem}">
<Setter Property="FocusVisualStyle" Value="{DynamicResource FocusVisual}" />
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
<!-- 使用父对象的边框色 -->
@@ -325,10 +325,10 @@
<ControlTemplate TargetType="{x:Type TabItem}">
<Border
Background="{TemplateBinding Background}"
CornerRadius="4"
x:Name="mainBorder"
Margin="2"
x:Name="mainBorder">
Background="{TemplateBinding Background}"
CornerRadius="4">
<Grid SnapsToDevicePixels="true">
<Border
BorderBrush="{TemplateBinding BorderBrush}"
@@ -337,27 +337,27 @@
<Border.Effect>
<DropShadowEffect
BlurRadius="6"
Color="{DynamicResource DarkShadowColor}"
Opacity="0.4"
ShadowDepth="2" />
ShadowDepth="2"
Color="{DynamicResource DarkShadowColor}" />
</Border.Effect>
</Border>
<ContentPresenter
x:Name="contentPresenter"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
ContentSource="Header"
Focusable="False"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="contentPresenter" />
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<Border
Background="{DynamicResource PrimaryGradientBrush}"
CornerRadius="1"
x:Name="stripLine"
Height="2"
Margin="4,2"
VerticalAlignment="Bottom"
x:Name="stripLine" />
Background="{DynamicResource PrimaryGradientBrush}"
CornerRadius="1" />
</Grid>
</Border>
@@ -365,34 +365,34 @@
<ControlTemplate.Triggers>
<!-- 靠左 -->
<DataTrigger Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left">
<Setter Property="Height" TargetName="stripLine" Value="auto" />
<Setter Property="Width" TargetName="stripLine" Value="3" />
<Setter Property="Margin" TargetName="stripLine" Value="2,6" />
<Setter Property="VerticalAlignment" TargetName="stripLine" Value="Stretch" />
<Setter Property="HorizontalAlignment" TargetName="stripLine" Value="Right" />
<Setter TargetName="stripLine" Property="Height" Value="auto" />
<Setter TargetName="stripLine" Property="Width" Value="3" />
<Setter TargetName="stripLine" Property="Margin" Value="2,6" />
<Setter TargetName="stripLine" Property="VerticalAlignment" Value="Stretch" />
<Setter TargetName="stripLine" Property="HorizontalAlignment" Value="Right" />
</DataTrigger>
<!-- 靠右 -->
<DataTrigger Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right">
<Setter Property="Height" TargetName="stripLine" Value="auto" />
<Setter Property="Width" TargetName="stripLine" Value="3" />
<Setter Property="Margin" TargetName="stripLine" Value="2,6" />
<Setter Property="VerticalAlignment" TargetName="stripLine" Value="Stretch" />
<Setter Property="HorizontalAlignment" TargetName="stripLine" Value="Left" />
<Setter TargetName="stripLine" Property="Height" Value="auto" />
<Setter TargetName="stripLine" Property="Width" Value="3" />
<Setter TargetName="stripLine" Property="Margin" Value="2,6" />
<Setter TargetName="stripLine" Property="VerticalAlignment" Value="Stretch" />
<Setter TargetName="stripLine" Property="HorizontalAlignment" Value="Left" />
</DataTrigger>
<!-- 下方 -->
<DataTrigger Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom">
<Setter Property="Height" TargetName="stripLine" Value="2" />
<Setter TargetName="stripLine" Property="Height" Value="2" />
<!--<Setter TargetName="stripLine" Property="Width" Value="3" />-->
<Setter Property="Margin" TargetName="stripLine" Value="4,2" />
<Setter Property="VerticalAlignment" TargetName="stripLine" Value="Top" />
<Setter Property="HorizontalAlignment" TargetName="stripLine" Value="Stretch" />
<Setter TargetName="stripLine" Property="Margin" Value="4,2" />
<Setter TargetName="stripLine" Property="VerticalAlignment" Value="Top" />
<Setter TargetName="stripLine" Property="HorizontalAlignment" Value="Stretch" />
</DataTrigger>
<!-- 未选中状态 -->
<Trigger Property="IsSelected" Value="False">
<Setter Property="Background" TargetName="mainBorder" Value="Transparent" />
<Setter TargetName="mainBorder" Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Effect" TargetName="mainBorder" Value="{x:Null}" />
<Setter Property="Visibility" TargetName="stripLine" Value="Hidden" />
<Setter TargetName="mainBorder" Property="Effect" Value="{x:Null}" />
<Setter TargetName="stripLine" Property="Visibility" Value="Hidden" />
<!--<Setter Property="Panel.ZIndex" Value="1"/>-->
</Trigger>
<!-- 高亮状态 -->
@@ -401,11 +401,11 @@
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsSelected" Value="False" />
</MultiTrigger.Conditions>
<Setter Property="Background" TargetName="mainBorder" Value="{DynamicResource ControlBackgroundSelectedBrush}" />
<Setter TargetName="mainBorder" Property="Background" Value="{DynamicResource ControlBackgroundSelectedBrush}" />
</MultiTrigger>
<!-- 禁用状态 -->
<Trigger Property="IsEnabled" Value="False">
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{DynamicResource TextDisabledBrush}" />
<Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TextDisabledBrush}" />
</Trigger>
@@ -415,7 +415,7 @@
</Setter>
</Style>
<Style TargetType="{x:Type TabControl}" x:Key="NavigationTabControlStyle">
<Style x:Key="NavigationTabControlStyle" TargetType="{x:Type TabControl}">
<Setter Property="BorderThickness" Value="1" />
<Setter Property="FontSize" Value="14" />
<Setter Property="Padding" Value="0" />
@@ -449,45 +449,45 @@
</Storyboard>
</ControlTemplate.Resources>
<Grid
x:Name="templateRoot"
ClipToBounds="true"
KeyboardNavigation.TabNavigation="Local"
SnapsToDevicePixels="true"
x:Name="templateRoot">
SnapsToDevicePixels="true">
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="ColumnDefinition0" />
<ColumnDefinition Width="0" x:Name="ColumnDefinition1" />
<ColumnDefinition x:Name="ColumnDefinition1" Width="0" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" x:Name="RowDefinition0" />
<RowDefinition Height="*" x:Name="RowDefinition1" />
<RowDefinition x:Name="RowDefinition0" Height="Auto" />
<RowDefinition x:Name="RowDefinition1" Height="*" />
</Grid.RowDefinitions>
<TabPanel
Background="Transparent"
Grid.Column="0"
x:Name="headerPanel"
Grid.Row="0"
IsItemsHost="true"
KeyboardNavigation.TabIndex="1"
Grid.Column="0"
Margin="2"
x:Name="headerPanel" />
Background="Transparent"
IsItemsHost="true"
KeyboardNavigation.TabIndex="1" />
<Border
x:Name="contentPanel"
Grid.Row="1"
Grid.Column="0"
Margin="4"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
ClipToBounds="True"
CornerRadius="4"
Grid.Column="0"
Grid.Row="1"
KeyboardNavigation.DirectionalNavigation="Contained"
KeyboardNavigation.TabIndex="2"
KeyboardNavigation.TabNavigation="Local"
Margin="4"
Opacity="1"
x:Name="contentPanel">
Opacity="1">
<ContentPresenter
ContentSource="SelectedContent"
x:Name="PART_SelectedContentHost"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
x:Name="PART_SelectedContentHost">
ContentSource="SelectedContent"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
<ContentPresenter.RenderTransform>
<TransformGroup>
<ScaleTransform />
@@ -502,42 +502,42 @@
<ControlTemplate.Triggers>
<Trigger Property="TabStripPlacement" Value="Bottom">
<!-- 设置布局 -->
<Setter Property="Grid.Row" TargetName="headerPanel" Value="1" />
<Setter Property="Grid.Row" TargetName="contentPanel" Value="0" />
<Setter Property="Height" TargetName="RowDefinition0" Value="*" />
<Setter Property="Height" TargetName="RowDefinition1" Value="Auto" />
<Setter TargetName="headerPanel" Property="Grid.Row" Value="1" />
<Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="RowDefinition0" Property="Height" Value="*" />
<Setter TargetName="RowDefinition1" Property="Height" Value="Auto" />
</Trigger>
<Trigger Property="TabStripPlacement" Value="Left">
<!-- 设置布局 -->
<Setter Property="Grid.Row" TargetName="headerPanel" Value="0" />
<Setter Property="Grid.Row" TargetName="contentPanel" Value="0" />
<Setter Property="Grid.Column" TargetName="headerPanel" Value="0" />
<Setter Property="Grid.Column" TargetName="contentPanel" Value="1" />
<Setter Property="Width" TargetName="ColumnDefinition0" Value="Auto" />
<Setter Property="Width" TargetName="ColumnDefinition1" Value="*" />
<Setter Property="Height" TargetName="RowDefinition0" Value="*" />
<Setter Property="Height" TargetName="RowDefinition1" Value="0" />
<Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="headerPanel" Property="Grid.Column" Value="0" />
<Setter TargetName="contentPanel" Property="Grid.Column" Value="1" />
<Setter TargetName="ColumnDefinition0" Property="Width" Value="Auto" />
<Setter TargetName="ColumnDefinition1" Property="Width" Value="*" />
<Setter TargetName="RowDefinition0" Property="Height" Value="*" />
<Setter TargetName="RowDefinition1" Property="Height" Value="0" />
</Trigger>
<Trigger Property="TabStripPlacement" Value="Right">
<!-- 设置布局 -->
<Setter Property="Grid.Row" TargetName="headerPanel" Value="0" />
<Setter Property="Grid.Row" TargetName="contentPanel" Value="0" />
<Setter Property="Grid.Column" TargetName="headerPanel" Value="1" />
<Setter Property="Grid.Column" TargetName="contentPanel" Value="0" />
<Setter Property="Width" TargetName="ColumnDefinition0" Value="*" />
<Setter Property="Width" TargetName="ColumnDefinition1" Value="Auto" />
<Setter Property="Height" TargetName="RowDefinition0" Value="*" />
<Setter Property="Height" TargetName="RowDefinition1" Value="0" />
<Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="headerPanel" Property="Grid.Column" Value="1" />
<Setter TargetName="contentPanel" Property="Grid.Column" Value="0" />
<Setter TargetName="ColumnDefinition0" Property="Width" Value="*" />
<Setter TargetName="ColumnDefinition1" Property="Width" Value="Auto" />
<Setter TargetName="RowDefinition0" Property="Height" Value="*" />
<Setter TargetName="RowDefinition1" Property="Height" Value="0" />
</Trigger>
<!-- 禁用效果 -->
<Trigger Property="IsEnabled" Value="false">
<Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="{DynamicResource TextDisabledBrush}" />
<Setter TargetName="templateRoot" Property="TextElement.Foreground" Value="{DynamicResource TextDisabledBrush}" />
</Trigger>
<EventTrigger RoutedEvent="SelectionChanged">
<BeginStoryboard Storyboard="{StaticResource FadeIn}" x:Name="fadeInEvent" />
<BeginStoryboard x:Name="fadeInEvent" Storyboard="{StaticResource FadeIn}" />
</EventTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>