You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
98 lines
2.2 KiB
98 lines
2.2 KiB
using ReactiveUI;
|
|
using System;
|
|
using System.Collections.ObjectModel;
|
|
|
|
namespace AuroraDesk.Core.Entities;
|
|
|
|
/// <summary>
|
|
/// 节点实体 - 表示画布上的一个可拖拽组件
|
|
/// </summary>
|
|
public class Node : ReactiveObject
|
|
{
|
|
private double _x;
|
|
private double _y;
|
|
private double _width = 120;
|
|
private double _height = 80;
|
|
private string _title = string.Empty;
|
|
private string _content = string.Empty;
|
|
private bool _isSelected;
|
|
private ObservableCollection<ConnectionPoint> _connectionPoints = new();
|
|
|
|
/// <summary>
|
|
/// 节点唯一标识符
|
|
/// </summary>
|
|
public string Id { get; set; } = Guid.NewGuid().ToString();
|
|
|
|
/// <summary>
|
|
/// X坐标位置
|
|
/// </summary>
|
|
public double X
|
|
{
|
|
get => _x;
|
|
set => this.RaiseAndSetIfChanged(ref _x, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Y坐标位置
|
|
/// </summary>
|
|
public double Y
|
|
{
|
|
get => _y;
|
|
set => this.RaiseAndSetIfChanged(ref _y, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 节点宽度
|
|
/// </summary>
|
|
public double Width
|
|
{
|
|
get => _width;
|
|
set => this.RaiseAndSetIfChanged(ref _width, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 节点高度
|
|
/// </summary>
|
|
public double Height
|
|
{
|
|
get => _height;
|
|
set => this.RaiseAndSetIfChanged(ref _height, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 节点标题
|
|
/// </summary>
|
|
public string Title
|
|
{
|
|
get => _title;
|
|
set => this.RaiseAndSetIfChanged(ref _title, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 节点内容(显示在节点内部的文本)
|
|
/// </summary>
|
|
public string Content
|
|
{
|
|
get => _content;
|
|
set => this.RaiseAndSetIfChanged(ref _content, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 是否被选中
|
|
/// </summary>
|
|
public bool IsSelected
|
|
{
|
|
get => _isSelected;
|
|
set => this.RaiseAndSetIfChanged(ref _isSelected, value);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 连接点集合
|
|
/// </summary>
|
|
public ObservableCollection<ConnectionPoint> ConnectionPoints
|
|
{
|
|
get => _connectionPoints;
|
|
set => this.RaiseAndSetIfChanged(ref _connectionPoints, value);
|
|
}
|
|
}
|
|
|
|
|