| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- using Prism.Mvvm;
- using System;
- using System.Windows;
- using Newtonsoft.Json;
- namespace TeamAAS.FlowEditor.Models
- {
- [Serializable]
- /// <summary>
- /// 节点间的连线
- /// </summary>
- public class FlowConnection : TeamAAS.BindableBase
- {
- public string ConnectionId { get; set; } = System.Guid.NewGuid().ToString("N");
- public string SourceNodeId { get; set; }
- public PortSide SourceSide { get; set; } = PortSide.Right;
- public string TargetNodeId { get; set; }
- public PortSide TargetSide { get; set; } = PortSide.Left;
- /// <summary>
- /// 分支条件(仅 BranchNode 的输出连线使用,如 "True"/"False")
- /// </summary>
- public string BranchCondition { get; set; }
- // ===== 以下为运行时属性(不序列化)=====
- [JsonIgnore]
- public Point SourcePosition
- {
- get => _sourcePosition;
- set => SetProperty(ref _sourcePosition, value);
- }
- private Point _sourcePosition;
- [JsonIgnore]
- public Point TargetPosition
- {
- get => _targetPosition;
- set => SetProperty(ref _targetPosition, value);
- }
- private Point _targetPosition;
- [JsonIgnore]
- public bool IsSelected
- {
- get => _isSelected;
- set => SetProperty(ref _isSelected, value);
- }
- private bool _isSelected;
- }
- }
|