定义嵌入式流程的编辑逻辑
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -55,6 +55,7 @@ namespace Deedy.Activity
|
||||
/// <returns>字段中的值</returns>
|
||||
protected virtual T GetField<T>(ref T field, [CallerMemberName] string? propertyName = null)
|
||||
{
|
||||
//TODO:这里处理内部属性获取逻辑(包括运行时参数映射逻辑)
|
||||
return field;
|
||||
}
|
||||
/// <summary>
|
||||
@@ -68,6 +69,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;
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace Deedy.Activity
|
||||
{
|
||||
@@ -10,5 +11,7 @@ namespace Deedy.Activity
|
||||
{
|
||||
public DragDropData() { }
|
||||
public DropPlacement Placement { get; set; }
|
||||
public DragDropEffects DragEffect { get; set; }
|
||||
public DragDropEffects DropEffects { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Deedy.Activity
|
||||
{
|
||||
public interface IContainerForFunction : IContainerElement
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否为嵌入式功能容器
|
||||
/// <para>True:不需要打开独立编辑器,选中时展开,手动折叠</para>
|
||||
/// <para>False:选中时需要打开独立编辑器,手动关闭(有多个选项卡;即,可以同时打开多个编辑器)</para>
|
||||
/// </summary>
|
||||
public bool IsEmbedded { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Deedy.Activity
|
||||
{
|
||||
public interface IFunctionAction : IElement
|
||||
{
|
||||
//TODO:这里需要定义信道,延迟执行与定时执行等参数
|
||||
}
|
||||
}
|
||||
12
DeedyDesigner/Deedy.Activity/Designer/ActionDesigner.xaml
Normal file
12
DeedyDesigner/Deedy.Activity/Designer/ActionDesigner.xaml
Normal file
@@ -0,0 +1,12 @@
|
||||
<UserControl x:Class="Deedy.Activity.ActionDesigner"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Deedy.Activity"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
60
DeedyDesigner/Deedy.Activity/Designer/ActionDesigner.xaml.cs
Normal file
60
DeedyDesigner/Deedy.Activity/Designer/ActionDesigner.xaml.cs
Normal file
@@ -0,0 +1,60 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace Deedy.Activity
|
||||
{
|
||||
/// <summary>
|
||||
/// ActionDesigner.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ActionDesigner : UserControl
|
||||
{
|
||||
private bool _PassthroughOpenDesignerEvent;
|
||||
public ActionDesigner()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
public ActionDesigner(IActionElement actionElement, bool passthroughOpenEvent = false) : this()
|
||||
{
|
||||
this.ActionElement = actionElement;
|
||||
this._PassthroughOpenDesignerEvent = passthroughOpenEvent;
|
||||
}
|
||||
/// <summary>
|
||||
/// 被托管的动作元素
|
||||
/// </summary>
|
||||
public IActionElement ActionElement
|
||||
{
|
||||
get { return (IActionElement)GetValue(ActionElementProperty); }
|
||||
set { SetValue(ActionElementProperty, value); }
|
||||
}
|
||||
public static readonly DependencyProperty ActionElementProperty =
|
||||
DependencyProperty.Register("ActionElement", typeof(IActionElement), typeof(ActionDesigner), new PropertyMetadata(null,
|
||||
(d, e) => (d as ActionDesigner)?.ActionElement_PropertyChangedCallback(e)));
|
||||
/// <summary>
|
||||
/// 处理「ActionDesigner.ActionElement」属性变更
|
||||
/// </summary>
|
||||
protected virtual void ActionElement_PropertyChangedCallback(DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
if (e.OldValue == e.NewValue) return;
|
||||
if (e.OldValue is IActionElement oldValue)
|
||||
{
|
||||
//TODO:解绑事件监听器
|
||||
}
|
||||
if (e.NewValue is IActionElement newValue)
|
||||
{
|
||||
//TODO:绑定事件监听器
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
12
DeedyDesigner/Deedy.Activity/Designer/VisualDesigner.xaml
Normal file
12
DeedyDesigner/Deedy.Activity/Designer/VisualDesigner.xaml
Normal file
@@ -0,0 +1,12 @@
|
||||
<UserControl x:Class="Deedy.Activity.VisualDesigner"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Deedy.Activity"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
28
DeedyDesigner/Deedy.Activity/Designer/VisualDesigner.xaml.cs
Normal file
28
DeedyDesigner/Deedy.Activity/Designer/VisualDesigner.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace Deedy.Activity
|
||||
{
|
||||
/// <summary>
|
||||
/// VisualDesigner.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class VisualDesigner : UserControl
|
||||
{
|
||||
public VisualDesigner()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user