Implementing a step control of the navigation type

This commit is contained in:
chinboy
2025-10-08 23:45:27 +08:00
parent 0787e9c65c
commit c82087ed54
5 changed files with 458 additions and 189 deletions
@@ -827,6 +827,8 @@ namespace AtomUI.Controls.DesignTokens
public static readonly TokenResourceKey VerticalDotMargin = new TokenResourceKey("Steps.VerticalDotMargin");
public static readonly TokenResourceKey VerticalItemSpacing = new TokenResourceKey("Steps.VerticalItemSpacing");
public static readonly TokenResourceKey VerticalLabelContentMargin = new TokenResourceKey("Steps.VerticalLabelContentMargin");
public static readonly TokenResourceKey VerticalNavArrowMargin = new TokenResourceKey("Steps.VerticalNavArrowMargin");
public static readonly TokenResourceKey VerticalNavArrowMarginSM = new TokenResourceKey("Steps.VerticalNavArrowMarginSM");
public static readonly TokenResourceKey WaitDescriptionColor = new TokenResourceKey("Steps.WaitDescriptionColor");
public static readonly TokenResourceKey WaitDotColor = new TokenResourceKey("Steps.WaitDotColor");
public static readonly TokenResourceKey WaitIconBgColor = new TokenResourceKey("Steps.WaitIconBgColor");
+13 -15
View File
@@ -377,7 +377,14 @@ public class Steps : SelectingItemsControl,
}
else
{
columnDefinitions.Add(new ColumnDefinition(GridLength.Auto));
if (Style == StepsStyle.Default || Style == StepsStyle.Inline)
{
columnDefinitions.Add(new ColumnDefinition(GridLength.Auto));
}
else
{
columnDefinitions.Add(new ColumnDefinition(GridLength.Star));
}
}
}
_grid.ColumnDefinitions = columnDefinitions;
@@ -387,14 +394,7 @@ public class Steps : SelectingItemsControl,
var rowDefinitions = new RowDefinitions();
for (var i = 0; i < count; i++)
{
if (i != count - 1)
{
rowDefinitions.Add(new RowDefinition(GridLength.Star));
}
else
{
rowDefinitions.Add(new RowDefinition(GridLength.Auto));
}
rowDefinitions.Add(new RowDefinition(GridLength.Auto));
}
_grid.RowDefinitions = rowDefinitions;
}
@@ -516,8 +516,7 @@ public class Steps : SelectingItemsControl,
protected override void OnPointerPressed(PointerPressedEventArgs e)
{
base.OnPointerPressed(e);
if (e.GetCurrentPoint(this).Properties.IsLeftButtonPressed && e.Pointer.Type == PointerType.Mouse)
if (IsItemClickable && e.GetCurrentPoint(this).Properties.IsLeftButtonPressed && e.Pointer.Type == PointerType.Mouse)
{
e.Handled = UpdateSelectionFromEventSource(e.Source);
}
@@ -525,12 +524,11 @@ public class Steps : SelectingItemsControl,
protected override void OnPointerReleased(PointerReleasedEventArgs e)
{
if (e.InitialPressMouseButton == MouseButton.Left && e.Pointer.Type != PointerType.Mouse)
if (IsItemClickable && e.InitialPressMouseButton == MouseButton.Left && e.Pointer.Type != PointerType.Mouse)
{
var container = GetContainerFromEventSource(e.Source);
if (container != null
&& container.GetVisualsAt(e.GetPosition(container))
.Any(c => container == c || container.IsVisualAncestorOf(c)))
if (container != null && container.GetVisualsAt(e.GetPosition(container))
.Any(c => container == c || container.IsVisualAncestorOf(c)))
{
e.Handled = UpdateSelectionFromEventSource(e.Source);
}
+32 -3
View File
@@ -2,7 +2,10 @@ using AtomUI.Animations;
using AtomUI.Controls.Themes;
using AtomUI.Controls.Utils;
using AtomUI.IconPkg;
using AtomUI.Theme.Styling;
using Avalonia;
using Avalonia.Animation;
using Avalonia.Animation.Easings;
using Avalonia.Controls;
using Avalonia.Controls.Metadata;
using Avalonia.Controls.Mixins;
@@ -144,6 +147,12 @@ public class StepsItem : HeaderedContentControl, ISelectable
internal static readonly StyledProperty<IBrush?> DescriptionForegroundProperty =
AvaloniaProperty.Register<StepsItem, IBrush?>(nameof(DescriptionForeground));
internal static readonly StyledProperty<IBrush?> NavIndicatorLineColorProperty =
AvaloniaProperty.Register<StepsItem, IBrush?>(nameof(NavIndicatorLineColor));
internal static readonly StyledProperty<ITransform?> NavIndicatorLineRenderTransformProperty =
AvaloniaProperty.Register<StepsItem, ITransform?>(nameof (NavIndicatorLineRenderTransform));
internal SizeType SizeType
{
get => GetValue(SizeTypeProperty);
@@ -223,6 +232,18 @@ public class StepsItem : HeaderedContentControl, ISelectable
get => GetValue(DescriptionForegroundProperty);
set => SetValue(DescriptionForegroundProperty, value);
}
internal IBrush? NavIndicatorLineColor
{
get => GetValue(NavIndicatorLineColorProperty);
set => SetValue(NavIndicatorLineColorProperty, value);
}
internal ITransform? NavIndicatorLineRenderTransform
{
get => GetValue(NavIndicatorLineRenderTransformProperty);
set => SetValue(NavIndicatorLineRenderTransformProperty, value);
}
#endregion
private StepsItemIndicator? _indicator;
@@ -258,6 +279,13 @@ public class StepsItem : HeaderedContentControl, ISelectable
{
UpdatePseudoClasses();
}
else if (change.Property == IsSelectedProperty)
{
if (_indicator != null)
{
_indicator.IsItemHover = false;
}
}
}
private void ConfigureTransitions(bool force)
@@ -271,7 +299,8 @@ public class StepsItem : HeaderedContentControl, ISelectable
TransitionUtils.CreateTransition<SolidColorBrushTransition>(BackgroundProperty),
TransitionUtils.CreateTransition<SolidColorBrushTransition>(ForegroundProperty),
TransitionUtils.CreateTransition<SolidColorBrushTransition>(SubTitleForegroundProperty),
TransitionUtils.CreateTransition<SolidColorBrushTransition>(DescriptionForegroundProperty)
TransitionUtils.CreateTransition<SolidColorBrushTransition>(DescriptionForegroundProperty),
TransitionUtils.CreateTransition<TransformOperationsTransition>(NavIndicatorLineRenderTransformProperty, SharedTokenKey.MotionDurationMid, new CubicEaseOut())
];
}
}
@@ -296,7 +325,7 @@ public class StepsItem : HeaderedContentControl, ISelectable
protected override void OnPointerEntered(PointerEventArgs e)
{
base.OnPointerEntered(e);
if (_indicator != null)
if (_indicator != null && !IsSelected)
{
_indicator.IsItemHover = true;
}
@@ -305,7 +334,7 @@ public class StepsItem : HeaderedContentControl, ISelectable
protected override void OnPointerExited(PointerEventArgs e)
{
base.OnPointerExited(e);
if (_indicator != null)
if (_indicator != null && !IsSelected)
{
_indicator.IsItemHover = false;
}
+14 -2
View File
@@ -98,6 +98,16 @@ internal class StepsToken : AbstractControlDesignToken
/// 垂直标签排列时候内容跟图标之间的外间距
/// </summary>
public Thickness VerticalLabelContentMargin { get; set; }
/// <summary>
/// 垂直导航类型箭头的外间距
/// </summary>
public Thickness VerticalNavArrowMargin { get; set; }
/// <summary>
/// 垂直导航类型箭头的外间距,小尺寸
/// </summary>
public Thickness VerticalNavArrowMarginSM { get; set; }
#region 内部 Token
@@ -198,8 +208,10 @@ internal class StepsToken : AbstractControlDesignToken
VerticalDescriptionPadding = new Thickness(0, 0, 0, SharedToken.UniformlyPaddingXS);
DotLineThickness = SharedToken.LineWidth * 3;
HorizontalDotMargin = new Thickness(SharedToken.UniformlyMarginXS, 0);
VerticalDotMargin = new Thickness(0, SharedToken.UniformlyMarginXS);
HorizontalDotMargin = new Thickness(SharedToken.UniformlyMarginXS, 0);
VerticalDotMargin = new Thickness(0, SharedToken.UniformlyMarginXS);
VerticalLabelContentMargin = new Thickness(0, SharedToken.UniformlyMarginSM, 0, 0);
VerticalNavArrowMargin = new Thickness(0, SharedToken.UniformlyMargin);
VerticalNavArrowMarginSM = new Thickness(0, SharedToken.UniformlyMarginSM);
}
}
@@ -4,7 +4,6 @@
xmlns:atom="https://atomui.net"
x:ClassModifier="internal">
<ControlTheme x:Key="{x:Type atom:StepsItem}" TargetType="atom:StepsItem">
<!-- 通用样式 -->
<Style Selector="^[IsClickable=True]">
<Style Selector="^[IsSelected=False]">
@@ -14,7 +13,7 @@
</Style>
</Style>
</Style>
<Style Selector="^ /template/ Rectangle.IndicatorLine">
<Setter Property="Fill" Value="{DynamicResource {x:Static atom:StepsTokenKey.ProcessTailColor}}" />
</Style>
@@ -36,7 +35,7 @@
Value="{DynamicResource {x:Static atom:StepsTokenKey.ProcessTitleColor}}" />
<Setter Property="DescriptionForeground"
Value="{DynamicResource {x:Static atom:StepsTokenKey.ProcessDescriptionColor}}" />
<Style Selector="^ /template/ Rectangle.IndicatorLine">
<Setter Property="Fill"
Value="{DynamicResource {x:Static atom:StepsTokenKey.ProcessTailColor}}" />
@@ -59,7 +58,7 @@
Value="{DynamicResource {x:Static atom:StepsTokenKey.ErrorTitleColor}}" />
<Setter Property="DescriptionForeground"
Value="{DynamicResource {x:Static atom:StepsTokenKey.ErrorDescriptionColor}}" />
<Style Selector="^ /template/ Rectangle.IndicatorLine">
<Setter Property="Fill"
Value="{DynamicResource {x:Static atom:StepsTokenKey.ErrorTailColor}}" />
@@ -67,7 +66,7 @@
</Style>
<Style Selector="^[IsSelected=False]">
<Setter Property="Foreground"
Value="{DynamicResource {x:Static atom:SharedTokenKey.ColorTextDescription}}" />
<Setter Property="SubTitleForeground"
@@ -104,59 +103,58 @@
Value="{DynamicResource {x:Static atom:SharedTokenKey.ColorTextDescription}}" />
</Style>
<Style Selector="^[Style=Default]">
<!-- 普通样式风格模板对应的通用样式 -->
<Style Selector="^ /template/ StackPanel#HeaderLayout">
<Setter Property="Spacing" Value="{DynamicResource {x:Static atom:SharedTokenKey.SpacingXS}}" />
</Style>
<Style Selector="^[SizeType=Large]">
<Style Selector="^ /template/ StackPanel#HeaderLayout">
<Setter Property="Spacing" Value="{DynamicResource {x:Static atom:SharedTokenKey.SpacingXS}}" />
<Setter Property="MinHeight"
Value="{DynamicResource {x:Static atom:SharedTokenKey.ControlHeight}}" />
</Style>
<Style Selector="^[SizeType=Large]">
<Style Selector="^ /template/ StackPanel#HeaderLayout">
<Setter Property="MinHeight"
Value="{DynamicResource {x:Static atom:SharedTokenKey.ControlHeight}}" />
</Style>
</Style>
<Style Selector="^[SizeType=Middle]">
<Style Selector="^ /template/ StackPanel#HeaderLayout">
<Setter Property="MinHeight"
Value="{DynamicResource {x:Static atom:SharedTokenKey.ControlHeight}}" />
</Style>
<Style Selector="^[SizeType=Middle]">
<Style Selector="^ /template/ StackPanel#HeaderLayout">
<Setter Property="MinHeight"
Value="{DynamicResource {x:Static atom:SharedTokenKey.ControlHeight}}" />
</Style>
</Style>
<Style Selector="^[SizeType=Small]">
<Style Selector="^ /template/ StackPanel#HeaderLayout">
<Setter Property="MinHeight"
Value="{DynamicResource {x:Static atom:StepsTokenKey.IconSizeSM}}" />
</Style>
</Style>
<Style Selector="^[SizeType=Small]">
<Style Selector="^ /template/ ContentPresenter#SubHeaderPresenter">
<Setter Property="FontSize" Value="{DynamicResource {x:Static atom:SharedTokenKey.FontSize}}" />
</Style>
<Style Selector="^ /template/ StackPanel#HeaderLayout">
<Setter Property="MinHeight"
Value="{DynamicResource {x:Static atom:StepsTokenKey.IconSizeSM}}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#DescriptionPresenter">
<Setter Property="FontSize" Value="{DynamicResource {x:Static atom:SharedTokenKey.FontSize}}" />
</Style>
<Style Selector="^[SizeType=Large]">
<Style Selector="^ /template/ ContentPresenter#HeaderPresenter">
<Setter Property="FontSize" Value="{DynamicResource {x:Static atom:SharedTokenKey.FontSizeLG}}" />
</Style>
</Style>
<Style Selector="^ /template/ ContentPresenter#SubHeaderPresenter">
<Style Selector="^[SizeType=Middle]">
<Style Selector="^ /template/ ContentPresenter#HeaderPresenter">
<Setter Property="FontSize" Value="{DynamicResource {x:Static atom:SharedTokenKey.FontSizeLG}}" />
</Style>
</Style>
<Style Selector="^[SizeType=Small]">
<Style Selector="^ /template/ ContentPresenter#HeaderPresenter">
<Setter Property="FontSize" Value="{DynamicResource {x:Static atom:SharedTokenKey.FontSize}}" />
</Style>
</Style>
<Style Selector="^ /template/ ContentPresenter#DescriptionPresenter">
<Setter Property="FontSize" Value="{DynamicResource {x:Static atom:SharedTokenKey.FontSize}}" />
</Style>
<Style Selector="^[SizeType=Large]">
<Style Selector="^ /template/ ContentPresenter#HeaderPresenter">
<Setter Property="FontSize" Value="{DynamicResource {x:Static atom:SharedTokenKey.FontSizeLG}}" />
</Style>
</Style>
<Style Selector="^[SizeType=Middle]">
<Style Selector="^ /template/ ContentPresenter#HeaderPresenter">
<Setter Property="FontSize" Value="{DynamicResource {x:Static atom:SharedTokenKey.FontSizeLG}}" />
</Style>
</Style>
<Style Selector="^[SizeType=Small]">
<Style Selector="^ /template/ ContentPresenter#HeaderPresenter">
<Setter Property="FontSize" Value="{DynamicResource {x:Static atom:SharedTokenKey.FontSize}}" />
</Style>
</Style>
<Style Selector="^[Style=Default]">
<!-- 普通样式水平风格模板 -->
<Style Selector="^[Orientation=Horizontal]">
<!-- 默认指示器类型 -->
@@ -232,116 +230,115 @@
</Style>
<!-- 点指示器类型 -->
<Style Selector="^[IndicatorType=Dot]">
<Style Selector="^[Orientation=Horizontal]">
<Setter Property="Template">
<ControlTemplate>
<DockPanel LastChildFill="True" Name="RootLayout">
<StackPanel Orientation="Vertical" DockPanel.Dock="Left">
<Grid Name="IndicatorLayout" VerticalAlignment="Top"
ColumnDefinitions="*, Auto, *">
<Rectangle Name="BeginningSeparatorLine"
Classes="IndicatorLine"
VerticalAlignment="Center"
IsVisible="{TemplateBinding IsFirst, Converter={x:Static BoolConverters.Not}}"
Grid.Column="0" />
<atom:StepsItemIndicator Name="{x:Static atom:StepsItemThemeConstants.IndicatorPart}"
IndicatorType="{TemplateBinding IndicatorType}"
UseLayoutRounding="False"
SizeType="{TemplateBinding SizeType}"
Position="{TemplateBinding Position}"
Icon="{TemplateBinding Icon}"
IsCurrent="{TemplateBinding IsSelected}"
IsClickable="{TemplateBinding IsClickable}"
VerticalAlignment="Center"
Status="{TemplateBinding Status}"
IsMotionEnabled="{TemplateBinding IsMotionEnabled}"
Grid.Column="1" />
<Rectangle Name="EndingSeparatorLine"
Classes="IndicatorLine"
VerticalAlignment="Center"
IsVisible="{TemplateBinding IsLast, Converter={x:Static BoolConverters.Not}}"
Grid.Column="2" />
</Grid>
<StackPanel Orientation="Horizontal" Name="HeaderLayout"
HorizontalAlignment="Center">
<ContentPresenter
Name="HeaderPresenter"
Content="{TemplateBinding Header}"
Foreground="{TemplateBinding Foreground}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
VerticalAlignment="Center" />
<ContentPresenter
Name="SubHeaderPresenter"
Content="{TemplateBinding SubHeader}"
ContentTemplate="{TemplateBinding SubHeaderTemplate}"
Foreground="{TemplateBinding SubTitleForeground}"
VerticalAlignment="Center"
IsVisible="{TemplateBinding SubHeader, Converter={x:Static ObjectConverters.IsNotNull}}" />
</StackPanel>
<ContentPresenter
Name="DescriptionPresenter"
Content="{TemplateBinding Description}"
Foreground="{TemplateBinding DescriptionForeground}"
ContentTemplate="{TemplateBinding DescriptionTemplate}"
TextAlignment="Center" />
</StackPanel>
<Panel Name="TailLineLayout" VerticalAlignment="Top">
<Rectangle Name="TailSeparatorLine"
<Setter Property="Template">
<ControlTemplate>
<DockPanel LastChildFill="True" Name="RootLayout">
<StackPanel Orientation="Vertical" DockPanel.Dock="Left">
<Grid Name="IndicatorLayout" VerticalAlignment="Top"
ColumnDefinitions="*, Auto, *">
<Rectangle Name="BeginningSeparatorLine"
Classes="IndicatorLine"
VerticalAlignment="Center"
IsVisible="{TemplateBinding IsLast, Converter={x:Static BoolConverters.Not}}" />
</Panel>
</DockPanel>
</ControlTemplate>
</Setter>
<Style Selector="^ /template/ Panel#TailLineLayout">
<Setter Property="Height"
Value="{DynamicResource {x:Static atom:StepsTokenKey.DotCurrentSize}}" />
</Style>
<Style Selector="^ /template/ Rectangle#TailSeparatorLine">
<Setter Property="Height"
Value="{DynamicResource {x:Static atom:StepsTokenKey.DotLineThickness}}" />
</Style>
<Style Selector="^ /template/ Rectangle#BeginningSeparatorLine">
<Setter Property="Height"
Value="{DynamicResource {x:Static atom:StepsTokenKey.DotLineThickness}}" />
</Style>
<Style Selector="^ /template/ Rectangle#EndingSeparatorLine">
<Setter Property="Height"
Value="{DynamicResource {x:Static atom:StepsTokenKey.DotLineThickness}}" />
</Style>
<Style Selector="^ /template/ Grid#IndicatorLayout">
<Setter Property="Height"
Value="{DynamicResource {x:Static atom:StepsTokenKey.DotCurrentSize}}" />
</Style>
<Style Selector="^ /template/ atom|StepsItemIndicator">
<Setter Property="Margin"
Value="{DynamicResource {x:Static atom:StepsTokenKey.HorizontalDotMargin}}" />
</Style>
<Style Selector="^[Status=Process]">
<Style Selector="^ /template/ Rectangle#BeginningSeparatorLine">
<Setter Property="Fill"
Value="{DynamicResource {x:Static atom:StepsTokenKey.FinishTailColor}}" />
</Style>
</Style>
<Style Selector="^ /template/ StackPanel#HeaderLayout">
<Setter Property="Margin"
Value="{DynamicResource {x:Static atom:StepsTokenKey.VerticalLabelContentMargin}}" />
</Style>
<Style Selector="^ /template/ StackPanel#ContentLayout">
<Setter Property="MaxWidth"
Value="{DynamicResource {x:Static atom:StepsTokenKey.DescriptionMaxWidth}}" />
</Style>
IsVisible="{TemplateBinding IsFirst, Converter={x:Static BoolConverters.Not}}"
Grid.Column="0" />
<atom:StepsItemIndicator
Name="{x:Static atom:StepsItemThemeConstants.IndicatorPart}"
IndicatorType="{TemplateBinding IndicatorType}"
UseLayoutRounding="False"
SizeType="{TemplateBinding SizeType}"
Position="{TemplateBinding Position}"
Icon="{TemplateBinding Icon}"
IsCurrent="{TemplateBinding IsSelected}"
IsClickable="{TemplateBinding IsClickable}"
VerticalAlignment="Center"
Status="{TemplateBinding Status}"
IsMotionEnabled="{TemplateBinding IsMotionEnabled}"
Grid.Column="1" />
<Rectangle Name="EndingSeparatorLine"
Classes="IndicatorLine"
VerticalAlignment="Center"
IsVisible="{TemplateBinding IsLast, Converter={x:Static BoolConverters.Not}}"
Grid.Column="2" />
</Grid>
<StackPanel Orientation="Horizontal" Name="HeaderLayout"
HorizontalAlignment="Center">
<ContentPresenter
Name="HeaderPresenter"
Content="{TemplateBinding Header}"
Foreground="{TemplateBinding Foreground}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
VerticalAlignment="Center" />
<ContentPresenter
Name="SubHeaderPresenter"
Content="{TemplateBinding SubHeader}"
ContentTemplate="{TemplateBinding SubHeaderTemplate}"
Foreground="{TemplateBinding SubTitleForeground}"
VerticalAlignment="Center"
IsVisible="{TemplateBinding SubHeader, Converter={x:Static ObjectConverters.IsNotNull}}" />
</StackPanel>
<ContentPresenter
Name="DescriptionPresenter"
Content="{TemplateBinding Description}"
Foreground="{TemplateBinding DescriptionForeground}"
ContentTemplate="{TemplateBinding DescriptionTemplate}"
TextAlignment="Center" />
</StackPanel>
<Panel Name="TailLineLayout" VerticalAlignment="Top">
<Rectangle Name="TailSeparatorLine"
Classes="IndicatorLine"
VerticalAlignment="Center"
IsVisible="{TemplateBinding IsLast, Converter={x:Static BoolConverters.Not}}" />
</Panel>
</DockPanel>
</ControlTemplate>
</Setter>
<Style Selector="^ /template/ Panel#TailLineLayout">
<Setter Property="Height"
Value="{DynamicResource {x:Static atom:StepsTokenKey.DotCurrentSize}}" />
</Style>
<Style Selector="^ /template/ Rectangle#TailSeparatorLine">
<Setter Property="Height"
Value="{DynamicResource {x:Static atom:StepsTokenKey.DotLineThickness}}" />
</Style>
<Style Selector="^ /template/ Rectangle#BeginningSeparatorLine">
<Setter Property="Height"
Value="{DynamicResource {x:Static atom:StepsTokenKey.DotLineThickness}}" />
</Style>
<Style Selector="^ /template/ Rectangle#EndingSeparatorLine">
<Setter Property="Height"
Value="{DynamicResource {x:Static atom:StepsTokenKey.DotLineThickness}}" />
</Style>
<Style Selector="^ /template/ Grid#IndicatorLayout">
<Setter Property="Height"
Value="{DynamicResource {x:Static atom:StepsTokenKey.DotCurrentSize}}" />
</Style>
<Style Selector="^ /template/ atom|StepsItemIndicator">
<Setter Property="Margin"
Value="{DynamicResource {x:Static atom:StepsTokenKey.HorizontalDotMargin}}" />
</Style>
<Style Selector="^[Status=Process]">
<Style Selector="^ /template/ Rectangle#BeginningSeparatorLine">
<Setter Property="Fill"
Value="{DynamicResource {x:Static atom:StepsTokenKey.FinishTailColor}}" />
</Style>
</Style>
<Style Selector="^ /template/ StackPanel#HeaderLayout">
<Setter Property="Margin"
Value="{DynamicResource {x:Static atom:StepsTokenKey.VerticalLabelContentMargin}}" />
</Style>
<Style Selector="^ /template/ StackPanel#ContentLayout">
<Setter Property="MaxWidth"
Value="{DynamicResource {x:Static atom:StepsTokenKey.DescriptionMaxWidth}}" />
</Style>
</Style>
</Style>
@@ -476,48 +473,279 @@
<Style Selector="^[SizeType=Large]">
<Style Selector="^ /template/ Panel#ItemIndicatorLayout">
<Setter Property="MinHeight" Value="{DynamicResource {x:Static atom:SharedTokenKey.ControlHeight}}" />
<Setter Property="MinHeight"
Value="{DynamicResource {x:Static atom:SharedTokenKey.ControlHeight}}" />
</Style>
</Style>
<Style Selector="^[SizeType=Middle]">
<Style Selector="^ /template/ Panel#ItemIndicatorLayout">
<Setter Property="MinHeight" Value="{DynamicResource {x:Static atom:SharedTokenKey.ControlHeight}}" />
<Setter Property="MinHeight"
Value="{DynamicResource {x:Static atom:SharedTokenKey.ControlHeight}}" />
</Style>
</Style>
<Style Selector="^[SizeType=Small]">
<Style Selector="^ /template/ DockPanel#ItemIndicatorLayout">
<Setter Property="MinHeight" Value="{DynamicResource {x:Static atom:StepsTokenKey.IconSizeSM}}" />
<Setter Property="MinHeight"
Value="{DynamicResource {x:Static atom:StepsTokenKey.IconSizeSM}}" />
</Style>
</Style>
<Style Selector="^ /template/ ContentPresenter#DescriptionPresenter">
<Setter Property="Padding"
Value="{DynamicResource {x:Static atom:StepsTokenKey.VerticalDescriptionPadding}}" />
</Style>
<Style Selector="^ /template/ DockPanel#RootLayout">
<Setter Property="HorizontalSpacing"
Value="{DynamicResource {x:Static atom:SharedTokenKey.Spacing}}" />
</Style>
</Style>
</Style>
</Style>
<!-- 导航类型 -->
<Style Selector="^[Style=Navigation]">
<Style Selector="^[LabelPlacement=Horizontal]">
<Setter Property="Template">
<ControlTemplate>
</ControlTemplate>
</Setter>
<!-- 导航类型通用的样式 -->
<Setter Property="NavIndicatorLineColor"
Value="{DynamicResource {x:Static atom:StepsTokenKey.StepsNavActiveColor}}" />
<Style Selector="^[Orientation=Horizontal]">
<Style Selector="^ /template/ Rectangle.NavIndicatorLine">
<Setter Property="Height"
Value="{DynamicResource {x:Static atom:SharedTokenKey.LineWidthBold}}" />
</Style>
<Setter Property="NavIndicatorLineRenderTransform" Value="scale(0.0, 1.0)" />
<Style Selector="^[IsSelected=True]">
<Setter Property="NavIndicatorLineRenderTransform" Value="scale(1.0, 1.0)" />
</Style>
</Style>
<Style Selector="^[LabelPlacement=Vertical]">
<Setter Property="Template">
<ControlTemplate>
</ControlTemplate>
</Setter>
<Style Selector="^[Orientation=Vertical]">
<Style Selector="^ /template/ Rectangle.NavIndicatorLine">
<Setter Property="Width"
Value="{DynamicResource {x:Static atom:SharedTokenKey.LineWidthBold}}" />
</Style>
<Setter Property="NavIndicatorLineRenderTransform" Value="scale(1.0, 0.0)" />
<Style Selector="^[IsSelected=True]">
<Setter Property="NavIndicatorLineRenderTransform" Value="scale(1.0, 1.0)" />
</Style>
<Style Selector="^[SizeType=Large]">
<Style Selector="^ /template/ atom|Icon#NavArrow">
<Setter Property="Margin"
Value="{DynamicResource {x:Static atom:StepsTokenKey.VerticalNavArrowMargin}}" />
</Style>
</Style>
<Style Selector="^[SizeType=Middle]">
<Style Selector="^ /template/ atom|Icon#NavArrow">
<Setter Property="Margin"
Value="{DynamicResource {x:Static atom:StepsTokenKey.VerticalNavArrowMargin}}" />
</Style>
</Style>
<Style Selector="^[SizeType=Small]">
<Style Selector="^ /template/ atom|Icon#NavArrow">
<Setter Property="Margin"
Value="{DynamicResource {x:Static atom:StepsTokenKey.VerticalNavArrowMarginSM}}" />
</Style>
</Style>
</Style>
<Style Selector="^ /template/ atom|Icon#NavArrow">
<Setter Property="NormalFilledBrush"
Value="{DynamicResource {x:Static atom:StepsTokenKey.NavArrowColor}}" />
<Setter Property="Width"
Value="{DynamicResource {x:Static atom:StepsTokenKey.IconFontSize}}" />
<Setter Property="Height"
Value="{DynamicResource {x:Static atom:StepsTokenKey.IconFontSize}}" />
</Style>
<Style Selector="^[IsSelected=True]">
<Style Selector="^ /template/ Rectangle.NavIndicatorLine">
<Setter Property="IsVisible" Value="True" />
</Style>
</Style>
<Style Selector="^[Orientation=Horizontal]">
<!-- 默认指示器类型 -->
<Style Selector="^[IndicatorType=Default]">
<Style Selector="^[LabelPlacement=Horizontal]">
<Setter Property="Template">
<ControlTemplate>
<DockPanel LastChildFill="True" Name="RootLayout">
<atom:Icon Name="NavArrow"
IconInfo="{atom:IconInfoProvider Kind=RightOutlined}"
DockPanel.Dock="Right"
VerticalAlignment="Center"
IsVisible="{TemplateBinding IsLast, Converter={x:Static BoolConverters.Not}}" />
<DockPanel LastChildFill="True">
<Rectangle DockPanel.Dock="Bottom" Classes="NavIndicatorLine"
IsVisible="False" Fill="{TemplateBinding NavIndicatorLineColor}"
RenderTransform="{TemplateBinding NavIndicatorLineRenderTransform}"
RenderTransformOrigin="{x:Static RelativePoint.Center}" />
<Panel>
<DockPanel LastChildFill="True" Name="ItemContentLayout"
HorizontalAlignment="Center">
<atom:StepsItemIndicator DockPanel.Dock="Left"
Name="{x:Static atom:StepsItemThemeConstants.IndicatorPart}"
IndicatorType="{TemplateBinding IndicatorType}"
IsCurrent="{TemplateBinding IsSelected}"
IsClickable="{TemplateBinding IsClickable}"
SizeType="{TemplateBinding SizeType}"
Position="{TemplateBinding Position}"
Icon="{TemplateBinding Icon}"
VerticalAlignment="Top"
Status="{TemplateBinding Status}"
IsMotionEnabled="{TemplateBinding IsMotionEnabled}" />
<StackPanel Orientation="Vertical">
<StackPanel Orientation="Horizontal" Name="HeaderLayout"
DockPanel.Dock="Left">
<ContentPresenter
Name="HeaderPresenter"
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
Foreground="{TemplateBinding Foreground}"
VerticalAlignment="Center" />
<ContentPresenter
Name="SubHeaderPresenter"
Content="{TemplateBinding SubHeader}"
ContentTemplate="{TemplateBinding SubHeaderTemplate}"
Foreground="{TemplateBinding SubTitleForeground}"
VerticalAlignment="Center"
IsVisible="{TemplateBinding SubHeader, Converter={x:Static ObjectConverters.IsNotNull}}" />
</StackPanel>
<ContentPresenter
Name="DescriptionPresenter"
Foreground="{TemplateBinding DescriptionForeground}"
Content="{TemplateBinding Description}"
ContentTemplate="{TemplateBinding DescriptionTemplate}" />
</StackPanel>
</DockPanel>
</Panel>
</DockPanel>
</DockPanel>
</ControlTemplate>
</Setter>
<Style Selector="^ /template/ DockPanel#ItemContentLayout">
<Setter Property="HorizontalSpacing"
Value="{DynamicResource {x:Static atom:SharedTokenKey.SpacingXS}}" />
</Style>
<Style Selector="^[IsClickable=True]">
<Style Selector="^ /template/ DockPanel#ItemContentLayout">
<Setter Property="Background" Value="Transparent" />
</Style>
</Style>
<Style Selector="^ /template/ StackPanel#HeaderLayout">
<Setter Property="Margin"
Value="{DynamicResource {x:Static atom:StepsTokenKey.HorizontalHeaderMargin}}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#DescriptionPresenter">
<Setter Property="Padding"
Value="{DynamicResource {x:Static atom:StepsTokenKey.VerticalDescriptionPadding}}" />
</Style>
</Style>
<Style Selector="^[LabelPlacement=Vertical]">
<Setter Property="Template">
<ControlTemplate>
</ControlTemplate>
</Setter>
</Style>
</Style>
<!-- 点指示器类型 -->
<Style Selector="^[IndicatorType=Dot]">
<Setter Property="Template">
<ControlTemplate>
</ControlTemplate>
</Setter>
</Style>
</Style>
<!-- 导航样式垂直风格模板 -->
<Style Selector="^[Orientation=Vertical]">
<!-- 普通指示器类型 -->
<Style Selector="^[IndicatorType=Default]">
<Setter Property="Template">
<ControlTemplate>
<DockPanel Name="RootLayout">
<Rectangle DockPanel.Dock="Right"
Classes="NavIndicatorLine"
IsVisible="False"
Fill="{TemplateBinding NavIndicatorLineColor}"
RenderTransform="{TemplateBinding NavIndicatorLineRenderTransform}"
RenderTransformOrigin="{x:Static RelativePoint.Center}" />
<Panel>
<DockPanel LastChildFill="True" Name="ItemContentLayout" HorizontalAlignment="Left">
<DockPanel DockPanel.Dock="Left">
<atom:StepsItemIndicator
Name="{x:Static atom:StepsItemThemeConstants.IndicatorPart}"
IndicatorType="{TemplateBinding IndicatorType}"
IsCurrent="{TemplateBinding IsSelected}"
IsClickable="{TemplateBinding IsClickable}"
SizeType="{TemplateBinding SizeType}"
Position="{TemplateBinding Position}"
Icon="{TemplateBinding Icon}"
VerticalAlignment="Top"
Status="{TemplateBinding Status}"
IsMotionEnabled="{TemplateBinding IsMotionEnabled}"
DockPanel.Dock="Top" />
<atom:Icon Name="NavArrow"
IconInfo="{atom:IconInfoProvider Kind=DownOutlined}"
HorizontalAlignment="Center"
DockPanel.Dock="Bottom"
IsVisible="{TemplateBinding IsLast, Converter={x:Static BoolConverters.Not}}" />
</DockPanel>
<StackPanel Orientation="Vertical" Name="ContentLayout">
<StackPanel Orientation="Horizontal" Name="HeaderLayout">
<ContentPresenter
Name="HeaderPresenter"
Foreground="{TemplateBinding Foreground}"
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
TextWrapping="Wrap"
VerticalAlignment="Center" />
<ContentPresenter
Name="SubHeaderPresenter"
Foreground="{TemplateBinding SubTitleForeground}"
Content="{TemplateBinding SubHeader}"
ContentTemplate="{TemplateBinding SubHeaderTemplate}"
VerticalAlignment="Center"
TextWrapping="Wrap"
IsVisible="{TemplateBinding SubHeader, Converter={x:Static ObjectConverters.IsNotNull}}" />
</StackPanel>
<ContentPresenter
Name="DescriptionPresenter"
Foreground="{TemplateBinding DescriptionForeground}"
Content="{TemplateBinding Description}"
ContentTemplate="{TemplateBinding DescriptionTemplate}"
TextWrapping="Wrap" />
</StackPanel>
</DockPanel>
</Panel>
</DockPanel>
</ControlTemplate>
</Setter>
<Style Selector="^ /template/ DockPanel#ItemContentLayout">
<Setter Property="HorizontalSpacing"
Value="{DynamicResource {x:Static atom:SharedTokenKey.Spacing}}" />
</Style>
<Style Selector="^ /template/ ContentPresenter#DescriptionPresenter">
<Setter Property="Padding"
Value="{DynamicResource {x:Static atom:StepsTokenKey.VerticalDescriptionPadding}}" />
</Style>
</Style>
</Style>
</Style>