Files
serein-flow/WorkBench/Node/ViewModel/ConditionNodeControlViewModel.cs

55 lines
1.4 KiB
C#
Raw Normal View History

2024-08-06 16:09:46 +08:00
using Serein.NodeFlow.Model;
using Serein.Workbench.Node.View;
2024-08-05 10:11:58 +08:00
namespace Serein.Workbench.Node.ViewModel
2024-08-05 10:11:58 +08:00
{
/// <summary>
/// 条件节点
/// </summary>
public class ConditionNodeControlViewModel : NodeControlViewModelBase
2024-08-05 10:11:58 +08:00
{
public new SingleConditionNode NodeModel { get; }
2024-08-05 10:11:58 +08:00
2024-10-28 21:52:45 +08:00
/// <summary>
/// 是否为自定义参数
/// </summary>
public bool IsCustomData
{
get => NodeModel.IsExplicitData;
set { NodeModel.IsExplicitData = value; OnPropertyChanged(); }
2024-10-28 21:52:45 +08:00
}
/// <summary>
/// 自定义参数值
/// </summary>
2024-11-02 16:48:40 +08:00
public string? CustomData
2024-10-28 21:52:45 +08:00
{
get => NodeModel.ExplicitData;
set { NodeModel.ExplicitData = value ; OnPropertyChanged(); }
2024-10-28 21:52:45 +08:00
}
/// <summary>
/// 表达式
/// </summary>
public string Expression
{
get => NodeModel.Expression;
set { NodeModel.Expression = value; OnPropertyChanged(); }
}
2024-08-05 10:11:58 +08:00
/// <summary>
/// 条件节点
/// </summary>
/// <param name="node"></param>
public ConditionNodeControlViewModel(SingleConditionNode node) : base(node)
2024-08-05 10:11:58 +08:00
{
this.NodeModel = node;
2024-11-02 16:48:40 +08:00
if(node is null)
{
IsCustomData = false;
CustomData = "";
Expression = "PASS";
}
2024-08-05 10:11:58 +08:00
}
}
}