追加缩进修正逻辑
This commit is contained in:
@@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// 缩进边距修正
|
||||
/// </summary>
|
||||
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;
|
||||
|
||||
/// <summary>
|
||||
/// 动作节点
|
||||
/// </summary>
|
||||
@@ -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;
|
||||
|
||||
@@ -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; }
|
||||
|
||||
Reference in New Issue
Block a user