using Prism.Mvvm;
using System;
using System.Windows;
using Newtonsoft.Json;
namespace TeamAAS.FlowEditor.Models
{
[Serializable]
///
/// 节点间的连线
///
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;
///
/// 分支条件(仅 BranchNode 的输出连线使用,如 "True"/"False")
///
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;
}
}