From 29dd0721f1e411abf3a5d8d8277d291d26fb24a2 Mon Sep 17 00:00:00 2001 From: zengwenjie <1663900244@qq.com> Date: Wed, 17 Sep 2025 12:08:20 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=BD=E5=8A=A0=E7=BC=A9=E8=BF=9B=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DeedyDesigner/Deedy.Activity/ActionViewer.cs | 19 +++++++++++++++++++ DeedyDesigner/Deedy.Activity/IActionViewer.cs | 4 ++++ 2 files changed, 23 insertions(+) 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; }