Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
jobily
HandyControl
提交
a21b400d
H
HandyControl
项目概览
jobily
/
HandyControl
10 个月 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
H
HandyControl
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
a21b400d
编写于
12月 17, 2022
作者:
N
NaBian
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: add TabControlSliding style.
上级
4c4af40b
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
792 addition
and
254 deletion
+792
-254
src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
+120
-8
src/Shared/HandyControlDemo_Shared/UserControl/Styles/NativeTabControlDemoCtl.xaml
...mo_Shared/UserControl/Styles/NativeTabControlDemoCtl.xaml
+124
-40
src/Shared/HandyControl_Shared/Controls/TabControl/SlidingTabContainer.cs
...Control_Shared/Controls/TabControl/SlidingTabContainer.cs
+121
-0
src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
+1
-0
src/Shared/HandyControl_Shared/Themes/Styles/Base/TabControlBaseStyle.xaml
...ontrol_Shared/Themes/Styles/Base/TabControlBaseStyle.xaml
+153
-137
src/Shared/HandyControl_Shared/Themes/Styles/TabControl.xaml
src/Shared/HandyControl_Shared/Themes/Styles/TabControl.xaml
+153
-61
src/Shared/HandyControl_Shared/Themes/Theme.xaml
src/Shared/HandyControl_Shared/Themes/Theme.xaml
+120
-8
未找到文件。
src/Net_40/HandyControl_Net_40/Themes/Theme.xaml
浏览文件 @
a21b400d
...
...
@@ -11038,7 +11038,7 @@
<RowDefinition x:Name="RowDefinition1" Height="*" />
</Grid.RowDefinitions>
<TabPanel x:Name="headerPanel" Background="Transparent" Grid.Column="0" IsItemsHost="true" Margin="0" Grid.Row="0" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1" />
<Border x:Name="contentPanel" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="{
Binding BorderThickness,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource ThicknessSplitConverter},ConverterParameter='0,1,0,0'
}" BorderBrush="{DynamicResource BorderBrush}" Background="{TemplateBinding Background}" Grid.Column="0" KeyboardNavigation.DirectionalNavigation="Contained" Grid.Row="1" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local">
<Border x:Name="contentPanel" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="{
TemplateBinding BorderThickness
}" BorderBrush="{DynamicResource BorderBrush}" Background="{TemplateBinding Background}" Grid.Column="0" KeyboardNavigation.DirectionalNavigation="Contained" Grid.Row="1" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local">
<ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
</Grid>
...
...
@@ -11048,7 +11048,6 @@
<Setter TargetName="RowDefinition1" Property="Height" Value="Auto" />
<Setter TargetName="headerPanel" Property="Grid.Row" Value="1" />
<Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="contentPanel" Property="BorderThickness" Value="{Binding BorderThickness,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource ThicknessSplitConverter},ConverterParameter='0,0,0,1'}" />
</Trigger>
<Trigger Property="TabStripPlacement" Value="Left">
<Setter TargetName="RowDefinition0" Property="Height" Value="*" />
...
...
@@ -11059,7 +11058,6 @@
<Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="contentPanel" Property="Grid.Column" Value="1" />
<Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="contentPanel" Property="BorderThickness" Value="{Binding BorderThickness,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource ThicknessSplitConverter},ConverterParameter='1,0,0,0'}" />
</Trigger>
<Trigger Property="TabStripPlacement" Value="Right">
<Setter TargetName="RowDefinition0" Property="Height" Value="*" />
...
...
@@ -11070,7 +11068,6 @@
<Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="contentPanel" Property="Grid.Column" Value="0" />
<Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="contentPanel" Property="BorderThickness" Value="{Binding BorderThickness,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource ThicknessSplitConverter},ConverterParameter='0,0,1,0'}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
...
...
@@ -11277,6 +11274,29 @@
</MultiTrigger>
</Style.Triggers>
</Style>
<Style x:Key="SlidingTabContainerBaseStyle" TargetType="hc:SlidingTabContainer">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Focusable" Value="False" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="Padding" Value="2" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="hc:SlidingTabContainer">
<Border HorizontalAlignment="Center" VerticalAlignment="Center" Padding="{TemplateBinding Padding}" Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}">
<hc:SimplePanel>
<Border x:Name="PART_Sliding" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" Width="0" Height="0" Effect="{StaticResource EffectShadow1}" Background="{Binding Path=(hc:TitleElement.Background),RelativeSource={RelativeSource TemplatedParent}}" HorizontalAlignment="Left" VerticalAlignment="Top">
<Border.RenderTransform>
<TranslateTransform />
</Border.RenderTransform>
</Border>
<ContentPresenter />
</hc:SimplePanel>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TimePickerBaseStyle" TargetType="hc:TimePicker">
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
<Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" />
...
...
@@ -13790,6 +13810,101 @@
<Style BasedOn="{StaticResource StepBarBaseStyle}" TargetType="hc:StepBar" />
<Style BasedOn="{StaticResource TabControlBaseStyle}" TargetType="TabControl" />
<Style BasedOn="{StaticResource TabControlPlusBaseStyle}" TargetType="hc:TabControl" />
<Style x:Key="TabItemSliding" TargetType="TabItem">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="MinHeight" Value="{StaticResource DefaultControlHeight}" />
<Setter Property="Padding" Value="10,0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TabItem">
<Border CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{DynamicResource BorderBrush}" Background="{TemplateBinding Background}">
<ContentPresenter x:Name="contentPresenter" ContentSource="Header" HorizontalAlignment="Center" VerticalAlignment="Center" TextElement.Foreground="{TemplateBinding Foreground}" Focusable="False" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Opacity" Value=".9" />
</Trigger>
<Trigger Property="IsSelected" Value="true">
<Setter Property="TextElement.Foreground" Value="{Binding Path=(hc:TitleElement.Foreground),RelativeSource={RelativeSource TemplatedParent}}" TargetName="contentPresenter" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.4" TargetName="contentPresenter" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style BasedOn="{StaticResource SlidingTabContainerBaseStyle}" TargetType="hc:SlidingTabContainer" />
<Style x:Key="TabControlSliding" TargetType="TabControl">
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}" />
<Setter Property="ItemContainerStyle" Value="{StaticResource TabItemSliding}" />
<Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" />
<Setter Property="hc:TitleElement.Background" Value="{DynamicResource RegionBrush}" />
<Setter Property="hc:TitleElement.Foreground" Value="{DynamicResource PrimaryTextBrush}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TabControl">
<Grid x:Name="templateRoot" ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
<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>
<hc:SlidingTabContainer x:Name="TabContainer" Background="{TemplateBinding Background}" Grid.Row="0" Grid.Column="0">
<StackPanel x:Name="headerPanel" Orientation="Horizontal" Background="Transparent" Margin="0" IsItemsHost="True" />
</hc:SlidingTabContainer>
<Border x:Name="contentPanel" Margin="0,6,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{DynamicResource BorderBrush}" Grid.Column="0" KeyboardNavigation.DirectionalNavigation="Contained" Grid.Row="1" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local">
<ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="TabStripPlacement" Value="Bottom">
<Setter TargetName="RowDefinition0" Property="Height" Value="*" />
<Setter TargetName="RowDefinition1" Property="Height" Value="Auto" />
<Setter TargetName="TabContainer" Property="Grid.Row" Value="1" />
<Setter TargetName="contentPanel" Property="Margin" Value="0,0,0,6" />
<Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
</Trigger>
<Trigger Property="TabStripPlacement" Value="Left">
<Setter TargetName="RowDefinition0" Property="Height" Value="*" />
<Setter TargetName="RowDefinition1" Property="Height" Value="0" />
<Setter TargetName="ColumnDefinition0" Property="Width" Value="Auto" />
<Setter TargetName="ColumnDefinition1" Property="Width" Value="*" />
<Setter TargetName="contentPanel" Property="Grid.Column" Value="1" />
<Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="contentPanel" Property="Margin" Value="6,0,0,0" />
<Setter TargetName="TabContainer" Property="Grid.Column" Value="0" />
<Setter TargetName="TabContainer" Property="Grid.Row" Value="0" />
<Setter TargetName="headerPanel" Property="Orientation" Value="Vertical" />
</Trigger>
<Trigger Property="TabStripPlacement" Value="Right">
<Setter TargetName="RowDefinition0" Property="Height" Value="*" />
<Setter TargetName="RowDefinition1" Property="Height" Value="0" />
<Setter TargetName="ColumnDefinition0" Property="Width" Value="*" />
<Setter TargetName="ColumnDefinition1" Property="Width" Value="Auto" />
<Setter TargetName="contentPanel" Property="Grid.Column" Value="0" />
<Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="contentPanel" Property="Margin" Value="0,0,6,0" />
<Setter TargetName="TabContainer" Property="Grid.Column" Value="1" />
<Setter TargetName="TabContainer" Property="Grid.Row" Value="0" />
<Setter TargetName="headerPanel" Property="Orientation" Value="Vertical" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TabItemInLine" BasedOn="{StaticResource TabItemStyle}" TargetType="TabItem">
<Setter Property="MinWidth" Value="0" />
</Style>
...
...
@@ -13808,7 +13923,7 @@
<RowDefinition x:Name="RowDefinition1" Height="*" />
</Grid.RowDefinitions>
<UniformGrid Rows="1" x:Name="headerPanel" Background="Transparent" Grid.Column="0" IsItemsHost="true" Margin="0" Grid.Row="0" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1" />
<Border x:Name="contentPanel" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="{
Binding BorderThickness,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource ThicknessSplitConverter},ConverterParameter='0,1,0,0'
}" BorderBrush="{DynamicResource BorderBrush}" Background="{TemplateBinding Background}" Grid.Column="0" KeyboardNavigation.DirectionalNavigation="Contained" Grid.Row="1" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local">
<Border x:Name="contentPanel" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="{
TemplateBinding BorderThickness
}" BorderBrush="{DynamicResource BorderBrush}" Background="{TemplateBinding Background}" Grid.Column="0" KeyboardNavigation.DirectionalNavigation="Contained" Grid.Row="1" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local">
<ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
</Grid>
...
...
@@ -13818,7 +13933,6 @@
<Setter TargetName="RowDefinition1" Property="Height" Value="Auto" />
<Setter TargetName="headerPanel" Property="Grid.Row" Value="1" />
<Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="contentPanel" Property="BorderThickness" Value="{Binding BorderThickness,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource ThicknessSplitConverter},ConverterParameter='0,0,0,1'}" />
</Trigger>
<Trigger Property="TabStripPlacement" Value="Left">
<Setter TargetName="RowDefinition0" Property="Height" Value="*" />
...
...
@@ -13827,7 +13941,6 @@
<Setter TargetName="ColumnDefinition1" Property="Width" Value="*" />
<Setter TargetName="contentPanel" Property="Grid.Column" Value="1" />
<Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="contentPanel" Property="BorderThickness" Value="{Binding BorderThickness,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource ThicknessSplitConverter},ConverterParameter='1,0,0,0'}" />
<Setter TargetName="headerPanel" Property="Grid.Column" Value="0" />
<Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="headerPanel" Property="Rows" Value="0" />
...
...
@@ -13840,7 +13953,6 @@
<Setter TargetName="ColumnDefinition1" Property="Width" Value="Auto" />
<Setter TargetName="contentPanel" Property="Grid.Column" Value="0" />
<Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="contentPanel" Property="BorderThickness" Value="{Binding BorderThickness,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource ThicknessSplitConverter},ConverterParameter='0,0,1,0'}" />
<Setter TargetName="headerPanel" Property="Grid.Column" Value="1" />
<Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="headerPanel" Property="Rows" Value="0" />
...
...
src/Shared/HandyControlDemo_Shared/UserControl/Styles/NativeTabControlDemoCtl.xaml
浏览文件 @
a21b400d
...
...
@@ -8,42 +8,126 @@
<hc:TransitioningContentControl>
<hc:ScrollViewer IsInertiaEnabled="True">
<hc:UniformSpacingPanel Margin="32" Spacing="32" ItemWidth="400" ItemHeight="200" MaxWidth="832" ChildWrapping="Wrap">
<TabControl SelectedIndex="3" Style="{StaticResource TabControlSliding}">
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}1">
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}" />
<Run Text="1" />
</TextBlock>
</Border>
</TabItem>
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}22" IsEnabled="False">
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}" />
<Run Text="2" />
</TextBlock>
</Border>
</TabItem>
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}333">
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}" />
<Run Text="3" />
</TextBlock>
</Border>
</TabItem>
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}4444">
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}" />
<Run Text="4" />
</TextBlock>
</Border>
</TabItem>
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}55555">
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}" />
<Run Text="5" />
</TextBlock>
</Border>
</TabItem>
</TabControl>
<TabControl Style="{StaticResource TabControlSliding}" TabStripPlacement="Bottom">
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}1">
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}" />
<Run Text="1" />
</TextBlock>
</Border>
</TabItem>
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}22" IsEnabled="False">
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}" />
<Run Text="2" />
</TextBlock>
</Border>
</TabItem>
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}333">
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}" />
<Run Text="3" />
</TextBlock>
</Border>
</TabItem>
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}4444">
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}" />
<Run Text="4" />
</TextBlock>
</Border>
</TabItem>
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}55555">
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}" />
<Run Text="5" />
</TextBlock>
</Border>
</TabItem>
</TabControl>
<TabControl TabStripPlacement="Right">
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}1">
<Border
Background="{DynamicResource PrimaryBrush}"
>
<TextBlock Style="{StaticResource TextBlockLargeBold}"
Foreground="{DynamicResource TextIconBrush}"
>
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}"/>
<Run Text="1"/>
</TextBlock>
</Border>
</TabItem>
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}2" IsEnabled="False">
<Border
Background="{DynamicResource SuccessBrush}"
>
<TextBlock Style="{StaticResource TextBlockLargeBold}"
Foreground="{DynamicResource TextIconBrush}"
>
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}"/>
<Run Text="2"/>
</TextBlock>
</Border>
</TabItem>
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}3">
<Border
Background="{DynamicResource InfoBrush}"
>
<TextBlock Style="{StaticResource TextBlockLargeBold}"
Foreground="{DynamicResource TextIconBrush}"
>
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}"/>
<Run Text="3"/>
</TextBlock>
</Border>
</TabItem>
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}4">
<Border
Background="{DynamicResource WarningBrush}"
>
<TextBlock Style="{StaticResource TextBlockLargeBold}"
Foreground="{DynamicResource TextIconBrush}"
>
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}"/>
<Run Text="4"/>
</TextBlock>
</Border>
</TabItem>
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}5">
<Border
Background="{DynamicResource DangerBrush}"
>
<TextBlock Style="{StaticResource TextBlockLargeBold}"
Foreground="{DynamicResource TextIconBrush}"
>
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}"/>
<Run Text="5"/>
</TextBlock>
...
...
@@ -52,40 +136,40 @@
</TabControl>
<TabControl Style="{StaticResource TabControlInLine}">
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}1">
<Border
Background="{DynamicResource PrimaryBrush}"
>
<TextBlock Style="{StaticResource TextBlockLargeBold}"
Foreground="{DynamicResource TextIconBrush}"
>
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}"/>
<Run Text="1"/>
</TextBlock>
</Border>
</TabItem>
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}2">
<Border
Background="{DynamicResource SuccessBrush}"
>
<TextBlock Style="{StaticResource TextBlockLargeBold}"
Foreground="{DynamicResource TextIconBrush}"
>
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}"/>
<Run Text="2"/>
</TextBlock>
</Border>
</TabItem>
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}3">
<Border
Background="{DynamicResource InfoBrush}"
>
<TextBlock Style="{StaticResource TextBlockLargeBold}"
Foreground="{DynamicResource TextIconBrush}"
>
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}"/>
<Run Text="3"/>
</TextBlock>
</Border>
</TabItem>
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}4">
<Border
Background="{DynamicResource WarningBrush}"
>
<TextBlock Style="{StaticResource TextBlockLargeBold}"
Foreground="{DynamicResource TextIconBrush}"
>
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}"/>
<Run Text="4"/>
</TextBlock>
</Border>
</TabItem>
<TabItem IsSelected="True" Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}5">
<Border
Background="{DynamicResource DangerBrush}"
>
<TextBlock Style="{StaticResource TextBlockLargeBold}"
Foreground="{DynamicResource TextIconBrush}"
>
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}"/>
<Run Text="5"/>
</TextBlock>
...
...
@@ -94,40 +178,40 @@
</TabControl>
<TabControl TabStripPlacement="Left" Style="{StaticResource TabControlCapsule}">
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}1">
<Border
Background="{DynamicResource PrimaryBrush}"
>
<TextBlock Style="{StaticResource TextBlockLargeBold}"
Foreground="{DynamicResource TextIconBrush}"
>
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}"/>
<Run Text="1"/>
</TextBlock>
</Border>
</TabItem>
<TabItem IsSelected="True" Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}2">
<Border
Background="{DynamicResource SuccessBrush}"
>
<TextBlock Style="{StaticResource TextBlockLargeBold}"
Foreground="{DynamicResource TextIconBrush}"
>
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}"/>
<Run Text="2"/>
</TextBlock>
</Border>
</TabItem>
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}3">
<Border
Background="{DynamicResource InfoBrush}"
>
<TextBlock Style="{StaticResource TextBlockLargeBold}"
Foreground="{DynamicResource TextIconBrush}"
>
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}"/>
<Run Text="3"/>
</TextBlock>
</Border>
</TabItem>
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}4">
<Border
Background="{DynamicResource WarningBrush}"
>
<TextBlock Style="{StaticResource TextBlockLargeBold}"
Foreground="{DynamicResource TextIconBrush}"
>
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}"/>
<Run Text="4"/>
</TextBlock>
</Border>
</TabItem>
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}5">
<Border
Background="{DynamicResource DangerBrush}"
>
<TextBlock Style="{StaticResource TextBlockLargeBold}"
Foreground="{DynamicResource TextIconBrush}"
>
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}"/>
<Run Text="5"/>
</TextBlock>
...
...
@@ -136,40 +220,40 @@
</TabControl>
<TabControl TabStripPlacement="Bottom" Style="{StaticResource TabControlCapsuleSolid}">
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}1">
<Border
Background="{DynamicResource PrimaryBrush}"
>
<TextBlock Style="{StaticResource TextBlockLargeBold}"
Foreground="{DynamicResource TextIconBrush}"
>
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}"/>
<Run Text="1"/>
</TextBlock>
</Border>
</TabItem>
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}2" IsEnabled="False">
<Border
Background="{DynamicResource SuccessBrush}"
>
<TextBlock Style="{StaticResource TextBlockLargeBold}"
Foreground="{DynamicResource TextIconBrush}"
>
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}"/>
<Run Text="2"/>
</TextBlock>
</Border>
</TabItem>
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}3">
<Border
Background="{DynamicResource InfoBrush}"
>
<TextBlock Style="{StaticResource TextBlockLargeBold}"
Foreground="{DynamicResource TextIconBrush}"
>
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}"/>
<Run Text="3"/>
</TextBlock>
</Border>
</TabItem>
<TabItem IsSelected="True" Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}4">
<Border
Background="{DynamicResource WarningBrush}"
>
<TextBlock Style="{StaticResource TextBlockLargeBold}"
Foreground="{DynamicResource TextIconBrush}"
>
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}"/>
<Run Text="4"/>
</TextBlock>
</Border>
</TabItem>
<TabItem Header="{ex:Lang Key={x:Static langs:LangKeys.Title}}" HeaderStringFormat="{}{0}5">
<Border
Background="{DynamicResource DangerBrush}"
>
<TextBlock Style="{StaticResource TextBlockLargeBold}"
Foreground="{DynamicResource TextIconBrush}"
>
<Border>
<TextBlock Style="{StaticResource TextBlockLargeBold}">
<Run Text="{ex:Lang Key={x:Static langs:LangKeys.Text}}"/>
<Run Text="5"/>
</TextBlock>
...
...
src/Shared/HandyControl_Shared/Controls/TabControl/SlidingTabContainer.cs
0 → 100644
浏览文件 @
a21b400d
using
System.Windows
;
using
System.Windows.Controls
;
using
System.Windows.Media
;
using
System.Windows.Media.Animation
;
using
HandyControl.Tools
;
namespace
HandyControl.Controls
;
[
TemplatePart
(
Name
=
ElementSliding
,
Type
=
typeof
(
FrameworkElement
))]
public
class
SlidingTabContainer
:
ContentControl
{
private
const
string
ElementSliding
=
"PART_Sliding"
;
private
FrameworkElement
_sliding
=
new
();
private
System
.
Windows
.
Controls
.
TabControl
_tabControl
;
public
SlidingTabContainer
()
{
Loaded
+=
OnLoaded
;
}
private
void
OnLoaded
(
object
sender
,
RoutedEventArgs
e
)
{
Loaded
-=
OnLoaded
;
OnSelectionChanged
(
null
,
null
);
}
public
override
void
OnApplyTemplate
()
{
if
(
_tabControl
is
not
null
)
{
_tabControl
.
SelectionChanged
-=
OnSelectionChanged
;
}
base
.
OnApplyTemplate
();
_tabControl
=
VisualHelper
.
GetParent
<
System
.
Windows
.
Controls
.
TabControl
>(
this
);
_sliding
=
GetTemplateChild
(
ElementSliding
)
as
FrameworkElement
;
if
(
_tabControl
is
not
null
)
{
_tabControl
.
SelectionChanged
+=
OnSelectionChanged
;
if
(
IsLoaded
)
{
OnSelectionChanged
(
null
,
null
);
}
}
}
protected
override
void
OnRenderSizeChanged
(
SizeChangedInfo
sizeInfo
)
{
base
.
OnRenderSizeChanged
(
sizeInfo
);
if
(
_tabControl
is
null
)
{
return
;
}
OnSelectionChanged
(
null
,
null
);
}
private
void
OnSelectionChanged
(
object
sender
,
SelectionChangedEventArgs
e
)
{
if
(
_sliding
is
null
||
!
IsLoaded
)
{
return
;
}
if
(
_tabControl
.
ItemContainerGenerator
.
ContainerFromItem
(
_tabControl
.
SelectedItem
)
is
not
System
.
Windows
.
Controls
.
TabItem
tabItem
)
{
return
;
}
var
offset
=
VisualTreeHelper
.
GetOffset
(
tabItem
);
var
tabWidth
=
tabItem
.
ActualWidth
;
var
tabHeight
=
tabItem
.
ActualHeight
;
var
useAnimation
=
_sliding
.
Width
>
0
&&
_sliding
.
Height
>
0
;
if
(
useAnimation
)
{
var
storyboard
=
new
Storyboard
();
var
easingFuction
=
new
PowerEase
{
EasingMode
=
EasingMode
.
EaseOut
,
};
var
widthAnimation
=
AnimationHelper
.
CreateAnimation
(
tabWidth
);
widthAnimation
.
EasingFunction
=
easingFuction
;
Storyboard
.
SetTarget
(
widthAnimation
,
_sliding
);
Storyboard
.
SetTargetProperty
(
widthAnimation
,
new
PropertyPath
(
WidthProperty
.
Name
));
storyboard
.
Children
.
Add
(
widthAnimation
);
var
heightAnimation
=
AnimationHelper
.
CreateAnimation
(
tabHeight
);
heightAnimation
.
EasingFunction
=
easingFuction
;
Storyboard
.
SetTarget
(
heightAnimation
,
_sliding
);
Storyboard
.
SetTargetProperty
(
heightAnimation
,
new
PropertyPath
(
HeightProperty
.
Name
));
storyboard
.
Children
.
Add
(
heightAnimation
);
var
xAnimation
=
AnimationHelper
.
CreateAnimation
(
offset
.
X
);
xAnimation
.
EasingFunction
=
easingFuction
;
Storyboard
.
SetTarget
(
xAnimation
,
_sliding
);
Storyboard
.
SetTargetProperty
(
xAnimation
,
new
PropertyPath
(
"(UIElement.RenderTransform).(TranslateTransform.X)"
));
storyboard
.
Children
.
Add
(
xAnimation
);
var
yAnimation
=
AnimationHelper
.
CreateAnimation
(
offset
.
Y
);
yAnimation
.
EasingFunction
=
easingFuction
;
Storyboard
.
SetTarget
(
yAnimation
,
_sliding
);
Storyboard
.
SetTargetProperty
(
yAnimation
,
new
PropertyPath
(
"(UIElement.RenderTransform).(TranslateTransform.Y)"
));
storyboard
.
Children
.
Add
(
yAnimation
);
storyboard
.
Begin
();
}
else
{
_sliding
.
Width
=
tabItem
.
ActualWidth
;
_sliding
.
Height
=
tabItem
.
ActualHeight
;
_sliding
.
RenderTransform
=
new
TranslateTransform
(
offset
.
X
,
offset
.
Y
);
}
}
}
src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
浏览文件 @
a21b400d
...
...
@@ -90,6 +90,7 @@
<Compile
Include=
"$(MSBuildThisFileDirectory)Controls\Slider\RangeSlider\RangeThumb.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Controls\Slider\RangeSlider\TwoWayRangeBase.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Controls\Block\RunningBlock\RunningBlock.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Controls\TabControl\SlidingTabContainer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Controls\Tag\TagContainer.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Controls\Text\HighlightTextBlock.cs"
/>
<Compile
Include=
"$(MSBuildThisFileDirectory)Controls\Text\SimpleText.cs"
/>
...
...
src/Shared/HandyControl_Shared/Themes/Styles/Base/TabControlBaseStyle.xaml
浏览文件 @
a21b400d
此差异已折叠。
点击以展开。
src/Shared/HandyControl_Shared/Themes/Styles/TabControl.xaml
浏览文件 @
a21b400d
此差异已折叠。
点击以展开。
src/Shared/HandyControl_Shared/Themes/Theme.xaml
浏览文件 @
a21b400d
...
...
@@ -11155,7 +11155,7 @@
<RowDefinition x:Name="RowDefinition1" Height="*" />
</Grid.RowDefinitions>
<TabPanel x:Name="headerPanel" Background="Transparent" Grid.Column="0" IsItemsHost="true" Margin="0" Grid.Row="0" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1" />
<Border x:Name="contentPanel" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="{
Binding BorderThickness,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource ThicknessSplitConverter},ConverterParameter='0,1,0,0'
}" BorderBrush="{DynamicResource BorderBrush}" Background="{TemplateBinding Background}" Grid.Column="0" KeyboardNavigation.DirectionalNavigation="Contained" Grid.Row="1" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local">
<Border x:Name="contentPanel" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="{
TemplateBinding BorderThickness
}" BorderBrush="{DynamicResource BorderBrush}" Background="{TemplateBinding Background}" Grid.Column="0" KeyboardNavigation.DirectionalNavigation="Contained" Grid.Row="1" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local">
<ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
</Grid>
...
...
@@ -11165,7 +11165,6 @@
<Setter TargetName="RowDefinition1" Property="Height" Value="Auto" />
<Setter TargetName="headerPanel" Property="Grid.Row" Value="1" />
<Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="contentPanel" Property="BorderThickness" Value="{Binding BorderThickness,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource ThicknessSplitConverter},ConverterParameter='0,0,0,1'}" />
</Trigger>
<Trigger Property="TabStripPlacement" Value="Left">
<Setter TargetName="RowDefinition0" Property="Height" Value="*" />
...
...
@@ -11176,7 +11175,6 @@
<Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="contentPanel" Property="Grid.Column" Value="1" />
<Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="contentPanel" Property="BorderThickness" Value="{Binding BorderThickness,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource ThicknessSplitConverter},ConverterParameter='1,0,0,0'}" />
</Trigger>
<Trigger Property="TabStripPlacement" Value="Right">
<Setter TargetName="RowDefinition0" Property="Height" Value="*" />
...
...
@@ -11187,7 +11185,6 @@
<Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="contentPanel" Property="Grid.Column" Value="0" />
<Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="contentPanel" Property="BorderThickness" Value="{Binding BorderThickness,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource ThicknessSplitConverter},ConverterParameter='0,0,1,0'}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
...
...
@@ -11394,6 +11391,29 @@
</MultiTrigger>
</Style.Triggers>
</Style>
<Style x:Key="SlidingTabContainerBaseStyle" TargetType="hc:SlidingTabContainer">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Focusable" Value="False" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="Padding" Value="2" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="hc:SlidingTabContainer">
<Border HorizontalAlignment="Center" VerticalAlignment="Center" Padding="{TemplateBinding Padding}" Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}">
<hc:SimplePanel>
<Border x:Name="PART_Sliding" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" Width="0" Height="0" Effect="{StaticResource EffectShadow1}" Background="{Binding Path=(hc:TitleElement.Background),RelativeSource={RelativeSource TemplatedParent}}" HorizontalAlignment="Left" VerticalAlignment="Top">
<Border.RenderTransform>
<TranslateTransform />
</Border.RenderTransform>
</Border>
<ContentPresenter />
</hc:SimplePanel>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TimePickerBaseStyle" TargetType="hc:TimePicker">
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
<Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" />
...
...
@@ -13938,6 +13958,101 @@
<Style BasedOn="{StaticResource StepBarBaseStyle}" TargetType="hc:StepBar" />
<Style BasedOn="{StaticResource TabControlBaseStyle}" TargetType="TabControl" />
<Style BasedOn="{StaticResource TabControlPlusBaseStyle}" TargetType="hc:TabControl" />
<Style x:Key="TabItemSliding" TargetType="TabItem">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="MinHeight" Value="{StaticResource DefaultControlHeight}" />
<Setter Property="Padding" Value="10,0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TabItem">
<Border CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{DynamicResource BorderBrush}" Background="{TemplateBinding Background}">
<ContentPresenter x:Name="contentPresenter" ContentSource="Header" HorizontalAlignment="Center" VerticalAlignment="Center" TextElement.Foreground="{TemplateBinding Foreground}" Focusable="False" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Opacity" Value=".9" />
</Trigger>
<Trigger Property="IsSelected" Value="true">
<Setter Property="TextElement.Foreground" Value="{Binding Path=(hc:TitleElement.Foreground),RelativeSource={RelativeSource TemplatedParent}}" TargetName="contentPresenter" />
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.4" TargetName="contentPresenter" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style BasedOn="{StaticResource SlidingTabContainerBaseStyle}" TargetType="hc:SlidingTabContainer" />
<Style x:Key="TabControlSliding" TargetType="TabControl">
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}" />
<Setter Property="ItemContainerStyle" Value="{StaticResource TabItemSliding}" />
<Setter Property="hc:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}" />
<Setter Property="hc:TitleElement.Background" Value="{DynamicResource RegionBrush}" />
<Setter Property="hc:TitleElement.Foreground" Value="{DynamicResource PrimaryTextBrush}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TabControl">
<Grid x:Name="templateRoot" ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
<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>
<hc:SlidingTabContainer x:Name="TabContainer" Background="{TemplateBinding Background}" Grid.Row="0" Grid.Column="0">
<StackPanel x:Name="headerPanel" Orientation="Horizontal" Background="Transparent" Margin="0" IsItemsHost="True" />
</hc:SlidingTabContainer>
<Border x:Name="contentPanel" Margin="0,6,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{DynamicResource BorderBrush}" Grid.Column="0" KeyboardNavigation.DirectionalNavigation="Contained" Grid.Row="1" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local">
<ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="TabStripPlacement" Value="Bottom">
<Setter TargetName="RowDefinition0" Property="Height" Value="*" />
<Setter TargetName="RowDefinition1" Property="Height" Value="Auto" />
<Setter TargetName="TabContainer" Property="Grid.Row" Value="1" />
<Setter TargetName="contentPanel" Property="Margin" Value="0,0,0,6" />
<Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
</Trigger>
<Trigger Property="TabStripPlacement" Value="Left">
<Setter TargetName="RowDefinition0" Property="Height" Value="*" />
<Setter TargetName="RowDefinition1" Property="Height" Value="0" />
<Setter TargetName="ColumnDefinition0" Property="Width" Value="Auto" />
<Setter TargetName="ColumnDefinition1" Property="Width" Value="*" />
<Setter TargetName="contentPanel" Property="Grid.Column" Value="1" />
<Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="contentPanel" Property="Margin" Value="6,0,0,0" />
<Setter TargetName="TabContainer" Property="Grid.Column" Value="0" />
<Setter TargetName="TabContainer" Property="Grid.Row" Value="0" />
<Setter TargetName="headerPanel" Property="Orientation" Value="Vertical" />
</Trigger>
<Trigger Property="TabStripPlacement" Value="Right">
<Setter TargetName="RowDefinition0" Property="Height" Value="*" />
<Setter TargetName="RowDefinition1" Property="Height" Value="0" />
<Setter TargetName="ColumnDefinition0" Property="Width" Value="*" />
<Setter TargetName="ColumnDefinition1" Property="Width" Value="Auto" />
<Setter TargetName="contentPanel" Property="Grid.Column" Value="0" />
<Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="contentPanel" Property="Margin" Value="0,0,6,0" />
<Setter TargetName="TabContainer" Property="Grid.Column" Value="1" />
<Setter TargetName="TabContainer" Property="Grid.Row" Value="0" />
<Setter TargetName="headerPanel" Property="Orientation" Value="Vertical" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="TabItemInLine" BasedOn="{StaticResource TabItemStyle}" TargetType="TabItem">
<Setter Property="MinWidth" Value="0" />
</Style>
...
...
@@ -13956,7 +14071,7 @@
<RowDefinition x:Name="RowDefinition1" Height="*" />
</Grid.RowDefinitions>
<UniformGrid Rows="1" x:Name="headerPanel" Background="Transparent" Grid.Column="0" IsItemsHost="true" Margin="0" Grid.Row="0" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1" />
<Border x:Name="contentPanel" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="{
Binding BorderThickness,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource ThicknessSplitConverter},ConverterParameter='0,1,0,0'
}" BorderBrush="{DynamicResource BorderBrush}" Background="{TemplateBinding Background}" Grid.Column="0" KeyboardNavigation.DirectionalNavigation="Contained" Grid.Row="1" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local">
<Border x:Name="contentPanel" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="{
TemplateBinding BorderThickness
}" BorderBrush="{DynamicResource BorderBrush}" Background="{TemplateBinding Background}" Grid.Column="0" KeyboardNavigation.DirectionalNavigation="Contained" Grid.Row="1" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Local">
<ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border>
</Grid>
...
...
@@ -13966,7 +14081,6 @@
<Setter TargetName="RowDefinition1" Property="Height" Value="Auto" />
<Setter TargetName="headerPanel" Property="Grid.Row" Value="1" />
<Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="contentPanel" Property="BorderThickness" Value="{Binding BorderThickness,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource ThicknessSplitConverter},ConverterParameter='0,0,0,1'}" />
</Trigger>
<Trigger Property="TabStripPlacement" Value="Left">
<Setter TargetName="RowDefinition0" Property="Height" Value="*" />
...
...
@@ -13975,7 +14089,6 @@
<Setter TargetName="ColumnDefinition1" Property="Width" Value="*" />
<Setter TargetName="contentPanel" Property="Grid.Column" Value="1" />
<Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="contentPanel" Property="BorderThickness" Value="{Binding BorderThickness,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource ThicknessSplitConverter},ConverterParameter='1,0,0,0'}" />
<Setter TargetName="headerPanel" Property="Grid.Column" Value="0" />
<Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="headerPanel" Property="Rows" Value="0" />
...
...
@@ -13988,7 +14101,6 @@
<Setter TargetName="ColumnDefinition1" Property="Width" Value="Auto" />
<Setter TargetName="contentPanel" Property="Grid.Column" Value="0" />
<Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="contentPanel" Property="BorderThickness" Value="{Binding BorderThickness,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource ThicknessSplitConverter},ConverterParameter='0,0,1,0'}" />
<Setter TargetName="headerPanel" Property="Grid.Column" Value="1" />
<Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
<Setter TargetName="headerPanel" Property="Rows" Value="0" />
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录