using ReactiveUI; using System; using System.Collections.ObjectModel; namespace AuroraDesk.Core.Entities; /// /// 节点实体 - 表示画布上的一个可拖拽组件 /// 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 _connectionPoints = new(); /// /// 节点唯一标识符 /// public string Id { get; set; } = Guid.NewGuid().ToString(); /// /// X坐标位置 /// public double X { get => _x; set => this.RaiseAndSetIfChanged(ref _x, value); } /// /// Y坐标位置 /// public double Y { get => _y; set => this.RaiseAndSetIfChanged(ref _y, value); } /// /// 节点宽度 /// public double Width { get => _width; set => this.RaiseAndSetIfChanged(ref _width, value); } /// /// 节点高度 /// public double Height { get => _height; set => this.RaiseAndSetIfChanged(ref _height, value); } /// /// 节点标题 /// public string Title { get => _title; set => this.RaiseAndSetIfChanged(ref _title, value); } /// /// 节点内容(显示在节点内部的文本) /// public string Content { get => _content; set => this.RaiseAndSetIfChanged(ref _content, value); } /// /// 是否被选中 /// public bool IsSelected { get => _isSelected; set => this.RaiseAndSetIfChanged(ref _isSelected, value); } /// /// 连接点集合 /// public ObservableCollection ConnectionPoints { get => _connectionPoints; set => this.RaiseAndSetIfChanged(ref _connectionPoints, value); } }