diff --git a/DeedyDesigner/Deedy.Activity/ActionViewer.cs b/DeedyDesigner/Deedy.Activity/ActionViewer.cs index b02dad9..a4eb42b 100644 --- a/DeedyDesigner/Deedy.Activity/ActionViewer.cs +++ b/DeedyDesigner/Deedy.Activity/ActionViewer.cs @@ -29,6 +29,9 @@ namespace Deedy.Activity [TemplatePart(Name = PART_StateDecorator, Type = typeof(ViewerStateDecorator))] public class ActionViewer : Control, IActionViewer { + public static double IndentRuler { get; set; } = 30; + + public const string PART_ItemsContainer = "PART_ItemsContainer"; public const string PART_TitleContainer = "PART_TitleContainer"; public const string PART_StateDecorator = "PART_StateDecorator"; @@ -509,6 +512,19 @@ namespace Deedy.Activity public static readonly DependencyPropertyKey MarginCorrection_TopBottomPropertyKey = DependencyProperty.RegisterReadOnly("MarginCorrection_TopBottom", typeof(Thickness), typeof(ActionViewer), new PropertyMetadata(new Thickness())); public static readonly DependencyProperty MarginCorrection_TopBottomProperty = MarginCorrection_TopBottomPropertyKey.DependencyProperty; + + /// + /// 缩进边距修正 + /// + public Thickness MarginCorrection_Indentation + { + get { return (Thickness)GetValue(MarginCorrection_IndentationProperty); } + protected internal set { SetValue(MarginCorrection_IndentationPropertyKey, value); } + } + public static readonly DependencyPropertyKey MarginCorrection_IndentationPropertyKey = + DependencyProperty.RegisterReadOnly("MarginCorrection_Indentation", typeof(Thickness), typeof(ActionViewer), new PropertyMetadata(new Thickness())); + public static readonly DependencyProperty MarginCorrection_IndentationProperty = MarginCorrection_IndentationPropertyKey.DependencyProperty; + /// /// 动作节点 /// @@ -633,6 +649,9 @@ namespace Deedy.Activity switch (e.PropertyName) { //TODO:处理托管的IActionElement节点的属性变更 + case nameof(IElement.DepthLevel): + this.MarginCorrection_Indentation = new Thickness(ActionViewer.IndentRuler * this.ActionElement.DepthLevel, 0, 0, 0); + break; case nameof(IActionElement.InstantInfo): this.InstantInfo = this.ActionElement.InstantInfo; break; diff --git a/DeedyDesigner/Deedy.Activity/IActionViewer.cs b/DeedyDesigner/Deedy.Activity/IActionViewer.cs index d5ea39e..f04d387 100644 --- a/DeedyDesigner/Deedy.Activity/IActionViewer.cs +++ b/DeedyDesigner/Deedy.Activity/IActionViewer.cs @@ -14,6 +14,9 @@ namespace Deedy.Activity { public interface IActionViewer : IActivity, INotifyPropertyChanged { + public static double IndentRuler { get; set; } + public static double LineHeight { get; set; } + [AllowNull] public IActionElement ActionElement { get; set; } public Visibility ShowBreakHandle { get; } @@ -46,6 +49,7 @@ namespace Deedy.Activity public Thickness MarginCorrection_Top { get; } public Thickness MarginCorrection_Bottom { get; } public Thickness MarginCorrection_TopBottom { get; } + public Thickness MarginCorrection_Indentation { get; } public ImageSource ElementIcon { get; } [AllowNull] public StyleSelector StyleSelector { get; set; }