Files
ShrlAlgoToolkit/Melskin/Controls/TabControl.xaml
2026-02-20 15:31:44 +08:00

548 lines
33 KiB
XML

<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:assists="clr-namespace:Melskin.Assists">
<!--#region 默认样式-->
<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" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<!-- 默认是 Top/Bottom 的样式,下划线 -->
<Border
x:Name="Border"
Padding="{TemplateBinding Padding}"
Background="Transparent"
BorderBrush="Transparent"
BorderThickness="0,0,0,2">
<ContentPresenter
x:Name="ContentSite"
HorizontalAlignment="Center"
VerticalAlignment="Center"
ContentSource="Header" />
</Border>
<ControlTemplate.Triggers>
<!-- 鼠标悬停效果 -->
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="{DynamicResource PrimaryNormalBrush}" />
</Trigger>
<!-- 选中效果 -->
<Trigger Property="IsSelected" Value="True">
<Setter Property="Foreground" 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 TargetName="Border" Property="BorderThickness" Value="0,2,0,0" />
</DataTrigger>
<DataTrigger Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Left">
<Setter TargetName="Border" Property="BorderThickness" Value="0,0,2,0" />
</DataTrigger>
<DataTrigger Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Right">
<Setter TargetName="Border" Property="BorderThickness" Value="2,0,0,0" />
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="FlattenTabControlStyle" TargetType="{x:Type TabControl}">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="ItemContainerStyle" Value="{StaticResource FlattenTabItemStyle}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabControl}">
<DockPanel
x:Name="templateRoot"
KeyboardNavigation.TabNavigation="Local"
LastChildFill="True">
<!-- 标签头容器 (默认停靠在顶部) -->
<Border
x:Name="HeaderPanelBorder"
BorderBrush="{DynamicResource BorderNormalBrush}"
BorderThickness="0,0,0,1"
DockPanel.Dock="Top">
<TabPanel
x:Name="HeaderPanel"
Margin="0"
Panel.ZIndex="1"
IsItemsHost="True" />
</Border>
<!-- 内容区域 (自动填充剩余空间) -->
<Border
x:Name="ContentPanelBorder"
Background="{TemplateBinding Background}"
BorderThickness="0">
<ContentPresenter
x:Name="PART_SelectedContentHost"
Margin="{TemplateBinding Padding}"
ContentSource="SelectedContent" />
</Border>
</DockPanel>
<ControlTemplate.Triggers>
<!-- 当标签在底部时 -->
<Trigger Property="TabStripPlacement" Value="Bottom">
<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 TargetName="HeaderPanelBorder" Property="DockPanel.Dock" Value="Left" />
<Setter TargetName="HeaderPanelBorder" Property="BorderThickness" Value="0,0,1,0" />
</Trigger>
<!-- 当标签在右侧时 -->
<Trigger Property="TabStripPlacement" Value="Right">
<Setter TargetName="HeaderPanelBorder" Property="DockPanel.Dock" Value="Right" />
<Setter TargetName="HeaderPanelBorder" Property="BorderThickness" Value="1,0,0,0" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!--#endregion-->
<!-- 默认Tab样式 -->
<Style TargetType="{x:Type TabItem}">
<Setter Property="FocusVisualStyle" Value="{DynamicResource FocusVisual}" />
<Setter Property="Foreground" Value="{DynamicResource TextInverseBrush}" />
<!-- 使用父对象的边框色 -->
<Setter Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type TabControl}}, Path=BorderBrush, Mode=OneWay}" />
<Setter Property="Margin" Value="0" />
<Setter Property="Padding" Value="8,4" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<Grid x:Name="templateRoot" SnapsToDevicePixels="true">
<Border
x:Name="mainBorder"
Margin="0,0,0,-1"
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"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<!-- 标识 -->
<Border
x:Name="separate"
Width="1"
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 TargetName="mainBorder" Property="CornerRadius" Value="4,0,0,4" />
<Setter TargetName="mainBorder" Property="Margin" Value="0,0,-1,0" />
<!-- 分隔符方向 -->
<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 TargetName="mainBorder" Property="CornerRadius" Value="0,4,4,0" />
<Setter TargetName="mainBorder" Property="Margin" Value="-1,0,0,0" />
<!-- 分隔符方向 -->
<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 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 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>
<!-- 高亮状态 -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsSelected" Value="False" />
</MultiTrigger.Conditions>
<Setter TargetName="mainBorder" Property="Background" Value="{DynamicResource ControlBackgroundSelectedBrush}" />
</MultiTrigger>
<!-- 禁用状态 -->
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="templateRoot" Property="TextElement.Foreground" Value="{DynamicResource TextDisabledBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type TabControl}">
<Setter Property="Margin" Value="4" />
<Setter Property="BorderThickness" Value="1,3,1,1" />
<Setter Property="FontSize" Value="14" />
<Setter Property="Padding" Value="0" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Background" Value="{DynamicResource BackgroundLayoutBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource BorderNormalBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabControl}">
<Grid
x:Name="templateRoot"
ClipToBounds="true"
KeyboardNavigation.TabNavigation="Local"
SnapsToDevicePixels="true">
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="ColumnDefinition0" />
<ColumnDefinition x:Name="ColumnDefinition1" Width="0" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition x:Name="RowDefinition0" Height="Auto" />
<RowDefinition x:Name="RowDefinition1" Height="*" />
</Grid.RowDefinitions>
<TabPanel
x:Name="headerPanel"
Grid.Row="0"
Grid.Column="0"
Panel.ZIndex="1"
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"
KeyboardNavigation.DirectionalNavigation="Contained"
KeyboardNavigation.TabIndex="2"
KeyboardNavigation.TabNavigation="Local">
<ContentPresenter
x:Name="PART_SelectedContentHost"
Margin="{TemplateBinding Padding}"
ContentSource="SelectedContent"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="TabStripPlacement" Value="Bottom">
<!-- 设置布局 -->
<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 TargetName="contentPanel" Property="CornerRadius" Value="4,4,0,0" />
</Trigger>
<Trigger Property="TabStripPlacement" Value="Left">
<!-- 设置布局 -->
<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 TargetName="contentPanel" Property="CornerRadius" Value="0,4,4,0" />
</Trigger>
<Trigger Property="TabStripPlacement" Value="Right">
<!-- 设置布局 -->
<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 TargetName="contentPanel" Property="CornerRadius" Value="4,0,0,4" />
</Trigger>
<!-- 禁用效果 -->
<Trigger Property="IsEnabled" Value="false">
<Setter TargetName="templateRoot" Property="TextElement.Foreground" Value="{DynamicResource TextDisabledBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 浮动Tab样式 -->
<Style x:Key="NavigationTabItemStyle" TargetType="{x:Type TabItem}">
<Setter Property="FocusVisualStyle" Value="{DynamicResource FocusVisual}" />
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
<!-- 使用父对象的边框色 -->
<Setter Property="BorderBrush" Value="{DynamicResource BorderNormalBrush}" />
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Margin" Value="0" />
<Setter Property="Padding" Value="10,6" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<Border
x:Name="mainBorder"
Margin="2"
Background="{TemplateBinding Background}"
CornerRadius="4">
<Grid SnapsToDevicePixels="true">
<Border
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="4">
<Border.Effect>
<DropShadowEffect
BlurRadius="6"
Opacity="0.4"
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"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<Border
x:Name="stripLine"
Height="2"
Margin="4,2"
VerticalAlignment="Bottom"
Background="{DynamicResource PrimaryGradientBrush}"
CornerRadius="1" />
</Grid>
</Border>
<ControlTemplate.Triggers>
<!-- 靠左 -->
<DataTrigger Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" 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="Right" />
</DataTrigger>
<!-- 靠右 -->
<DataTrigger Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" 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="Left" />
</DataTrigger>
<!-- 下方 -->
<DataTrigger Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType={x:Type TabControl}}}" Value="Bottom">
<Setter TargetName="stripLine" Property="Height" Value="2" />
<!--<Setter TargetName="stripLine" Property="Width" Value="3" />-->
<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 TargetName="mainBorder" Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter TargetName="mainBorder" Property="Effect" Value="{x:Null}" />
<Setter TargetName="stripLine" Property="Visibility" Value="Hidden" />
<!--<Setter Property="Panel.ZIndex" Value="1"/>-->
</Trigger>
<!-- 高亮状态 -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="IsSelected" Value="False" />
</MultiTrigger.Conditions>
<Setter TargetName="mainBorder" Property="Background" Value="{DynamicResource ControlBackgroundSelectedBrush}" />
</MultiTrigger>
<!-- 禁用状态 -->
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="{DynamicResource TextDisabledBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="NavigationTabControlStyle" TargetType="{x:Type TabControl}">
<Setter Property="BorderThickness" Value="1" />
<Setter Property="FontSize" Value="14" />
<Setter Property="Padding" Value="0" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Background" Value="{DynamicResource BackgroundLayoutBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource BorderNormalBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
<Setter Property="ItemContainerStyle" Value="{StaticResource NavigationTabItemStyle}" />
<Setter Property="assists:TabAssist.UseFadeIn" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabControl}">
<ControlTemplate.Resources>
<Storyboard x:Key="FadeIn">
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_SelectedContentHost" Storyboard.TargetProperty="Opacity">
<SplineDoubleKeyFrame KeyTime="0" Value="0" />
<SplineDoubleKeyFrame
KeySpline="0.2,1 0.2,1"
KeyTime="0:0:0.5"
Value="1" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetName="PART_SelectedContentHost" Storyboard.TargetProperty="(UIElement.RenderTransform) .(TransformGroup.Children)[3].Y">
<SplineDoubleKeyFrame KeyTime="0" Value="80" />
<SplineDoubleKeyFrame
KeySpline="0.2,1 0.2,1"
KeyTime="0:0:0.5"
Value="0" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</ControlTemplate.Resources>
<Grid
x:Name="templateRoot"
ClipToBounds="true"
KeyboardNavigation.TabNavigation="Local"
SnapsToDevicePixels="true">
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="ColumnDefinition0" />
<ColumnDefinition x:Name="ColumnDefinition1" Width="0" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition x:Name="RowDefinition0" Height="Auto" />
<RowDefinition x:Name="RowDefinition1" Height="*" />
</Grid.RowDefinitions>
<TabPanel
x:Name="headerPanel"
Grid.Row="0"
Grid.Column="0"
Margin="2"
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"
KeyboardNavigation.DirectionalNavigation="Contained"
KeyboardNavigation.TabIndex="2"
KeyboardNavigation.TabNavigation="Local"
Opacity="1">
<ContentPresenter
x:Name="PART_SelectedContentHost"
Margin="{TemplateBinding Padding}"
ContentSource="SelectedContent"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
<ContentPresenter.RenderTransform>
<TransformGroup>
<ScaleTransform />
<SkewTransform />
<RotateTransform />
<TranslateTransform Y="0" />
</TransformGroup>
</ContentPresenter.RenderTransform>
</ContentPresenter>
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="TabStripPlacement" Value="Bottom">
<!-- 设置布局 -->
<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 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 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 TargetName="templateRoot" Property="TextElement.Foreground" Value="{DynamicResource TextDisabledBrush}" />
</Trigger>
<EventTrigger RoutedEvent="SelectionChanged">
<BeginStoryboard x:Name="fadeInEvent" Storyboard="{StaticResource FadeIn}" />
</EventTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>