定义嵌入式流程的编辑逻辑

This commit is contained in:
zengwenjie
2025-09-17 11:54:04 +08:00
parent 0f616421ec
commit 1df6b8862a
9 changed files with 174 additions and 3 deletions

View File

@@ -46,7 +46,7 @@ namespace Deedy.Activity
{
ToolTipService.SetInitialShowDelay(this, 0);
ToolTipService.SetBetweenShowDelay(this, 0);
this.LogInfos = new LogInfoCollection();
this.LogInfos = new();
}
public override void OnApplyTemplate()
{
@@ -72,6 +72,7 @@ namespace Deedy.Activity
/// <returns>字段中的值</returns>
protected virtual T GetField<T>(ref T field, [CallerMemberName] string? propertyName = null)
{
//TODO这里处理内部属性获取逻辑包括运行时参数映射逻辑
return field;
}
/// <summary>
@@ -85,6 +86,7 @@ namespace Deedy.Activity
protected virtual bool SetField<T>(ref T field, T value, [CallerMemberName] string? propertyName = null)
{
if (EqualityComparer<T>.Default.Equals(field, value)) return false;
//TODO这里处理内部属性变更逻辑包括运行时参数映射逻辑
field = value;
OnPropertyChanged(propertyName);
return true;
@@ -294,8 +296,28 @@ namespace Deedy.Activity
protected internal set { SetValue(IsSelectedPropertyKey, value); }
}
public static readonly DependencyPropertyKey IsSelectedPropertyKey =
DependencyProperty.RegisterReadOnly("IsSelected", typeof(bool), typeof(ActionViewer), new PropertyMetadata(false));
DependencyProperty.RegisterReadOnly("IsSelected", typeof(bool), typeof(ActionViewer), new PropertyMetadata(false,
(d, e) => (d as ActionViewer)?.IsSelected_PropertyChangedCallback(e)));
public static readonly DependencyProperty IsSelectedProperty = IsSelectedPropertyKey.DependencyProperty;
/// <summary>
/// 处理「ActionViewer.IsSelected」属性变更
/// </summary>
protected virtual void IsSelected_PropertyChangedCallback(DependencyPropertyChangedEventArgs e)
{
if ((bool)e.NewValue)
{
//TODO发送节点选中事件
if (this.ActionElement is IContainerForFunction container)
{
if (container.IsEmbedded) this.IsExpanded = true;
else
{
//TODO发送打开辅助编辑器事件
}
}
}
this.RefreshViewerState();
}
/// <summary>
/// 是否可被展开
@@ -546,7 +568,7 @@ namespace Deedy.Activity
if (newValue.IsLockedElement)
{
this.IsDraggable = false;
this.IsSelectable = false;
this.IsSelectable = newValue is IContainerForFunction;
}
else
{
@@ -577,6 +599,7 @@ namespace Deedy.Activity
// 新元素被托管渲染后调整子元素退出线位置
withExitline.AdjustExitlinePosition();
}
if (newValue is ILogicController logicController)
{
switch (logicController.LogicalBehavior)