mirror of
https://gitee.com/wang-yin1/wpf-visual-process-framework
synced 2026-03-03 00:00:56 +08:00
添加项目文件。
This commit is contained in:
64
VisionFrame/Models/NodeModel.cs
Normal file
64
VisionFrame/Models/NodeModel.cs
Normal file
@@ -0,0 +1,64 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using Zhaoxi.VisionFrame.Base;
|
||||
|
||||
namespace Zhaoxi.VisionFrame.Models
|
||||
{
|
||||
public class NodeModel : ObservableObject
|
||||
{
|
||||
// 每个节点实例 唯一编号
|
||||
public string NodeId { get; } = Guid.NewGuid().ToString();
|
||||
|
||||
public object TargetNodeObject { get; set; }
|
||||
|
||||
|
||||
private double _x;
|
||||
|
||||
public double X
|
||||
{
|
||||
get { return _x; }
|
||||
set { SetProperty<double>(ref _x, value); }
|
||||
}
|
||||
private double _y;
|
||||
|
||||
public double Y
|
||||
{
|
||||
get { return _y; }
|
||||
set { SetProperty<double>(ref _y, value); }
|
||||
}
|
||||
|
||||
public double W { get; set; }
|
||||
public double H { get; set; }
|
||||
|
||||
|
||||
private bool _isSelected = false;
|
||||
|
||||
public bool IsSelected
|
||||
{
|
||||
get { return _isSelected; }
|
||||
set { SetProperty<bool>(ref _isSelected, value); }
|
||||
}
|
||||
|
||||
|
||||
public bool ShowAnchorT { get; set; } = true;
|
||||
public bool ShowAnchorB { get; set; } = true;
|
||||
public bool ShowAnchorL { get; set; } = true;
|
||||
public bool ShowAnchorR { get; set; } = true;
|
||||
|
||||
public void SetAnchorShow(string anchor, bool show)
|
||||
{
|
||||
PropertyInfo pi = this.GetType().GetProperty("ShowAnchor" + anchor);
|
||||
if (pi != null)
|
||||
{
|
||||
pi.SetValue(this, show);
|
||||
this.OnPropertyChanged("ShowAnchor" + anchor);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user