设计了流程接口节点,能够切换本节点数据、目标节点数据,目前还有数据来源相关操作没有实现

This commit is contained in:
fengjiayi
2025-05-28 23:19:00 +08:00
parent f7cae3493f
commit a5715be929
44 changed files with 1064 additions and 277 deletions

View File

@@ -14,6 +14,7 @@ using System.Windows.Documents;
using System.Threading;
using Serein.Workbench.Services;
using Serein.Workbench.Tool;
using System.ComponentModel;
namespace Serein.Workbench.Node.View
{
@@ -169,15 +170,24 @@ namespace Serein.Workbench.Node.View
private readonly FlowNodeService flowNodeService;
protected JunctionControlBase()
{
flowNodeService = App.GetService<FlowNodeService>();
this.Width = 25;
this.Height = 20;
this.MouseDown += JunctionControlBase_MouseDown;
this.MouseMove += JunctionControlBase_MouseMove;
this.MouseLeave += JunctionControlBase_MouseLeave; ;
this.MouseLeave += JunctionControlBase_MouseLeave;
#if DEBUG
if (DesignerProperties.GetIsInDesignMode(new DependencyObject()))
return;
#endif
flowNodeService = App.GetService<FlowNodeService>();
}
#region
public static readonly DependencyProperty NodeProperty =
DependencyProperty.Register(nameof(MyNode), typeof(NodeModelBase), typeof(JunctionControlBase), new PropertyMetadata(default(NodeModelBase)));
@@ -238,7 +248,11 @@ namespace Serein.Workbench.Node.View
{
if(_isMouseOver != value)
{
flowNodeService.ConnectingData.CurrentJunction = this;
if(flowNodeService is not null)
{
flowNodeService.ConnectingData.CurrentJunction = this;
}
_isMouseOver = value;
InvalidateVisual();
}
@@ -261,6 +275,10 @@ namespace Serein.Workbench.Node.View
/// <returns></returns>
protected Brush GetBackgrounp()
{
if(flowNodeService is null)
{
return Brushes.Transparent;
}
var cd = flowNodeService.ConnectingData;
if(!cd.IsCreateing)
{