2025-01-05 08:52:37 +08:00
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
|
using Serein.Library;
|
|
|
|
|
|
using System.Runtime.CompilerServices;
|
|
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
|
using System.Windows.Data;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
|
|
namespace Serein.Workbench.Node.ViewModel
|
|
|
|
|
|
{
|
|
|
|
|
|
public abstract class NodeControlViewModelBase
|
|
|
|
|
|
{
|
2025-03-17 10:14:18 +08:00
|
|
|
|
|
2025-01-05 08:52:37 +08:00
|
|
|
|
///// <summary>
|
|
|
|
|
|
///// 对应的节点实体类
|
|
|
|
|
|
///// </summary>
|
|
|
|
|
|
public NodeModelBase NodeModel { get; }
|
|
|
|
|
|
|
|
|
|
|
|
public NodeControlViewModelBase(NodeModelBase nodeModel)
|
|
|
|
|
|
{
|
|
|
|
|
|
NodeModel = nodeModel;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private bool isInterrupt;
|
2025-03-17 10:14:18 +08:00
|
|
|
|
private bool isReadonlyOnView = true;
|
|
|
|
|
|
|
2025-01-05 08:52:37 +08:00
|
|
|
|
///// <summary>
|
|
|
|
|
|
///// 控制中断状态的视觉效果
|
|
|
|
|
|
///// </summary>
|
|
|
|
|
|
public bool IsInterrupt
|
|
|
|
|
|
{
|
|
|
|
|
|
get => NodeModel.DebugSetting.IsInterrupt;
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
NodeModel.DebugSetting.IsInterrupt = value;
|
|
|
|
|
|
OnPropertyChanged();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-03-17 10:14:18 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// 工作台预览基本节点时,避免其中的文本框响应拖拽事件导致卡死
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public bool IsEnabledOnView { get => isReadonlyOnView; set
|
|
|
|
|
|
{
|
|
|
|
|
|
OnPropertyChanged(); isReadonlyOnView = value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-01-05 08:52:37 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public event PropertyChangedEventHandler? PropertyChanged;
|
|
|
|
|
|
protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
|
|
|
|
|
{
|
|
|
|
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|