1
0
mirror of https://github.com/Artemis-RGB/Artemis synced 2025-12-13 05:48:35 +00:00
Artemis/src/Artemis.VisualScripting/Nodes/List/Screens/ListOperatorNodeCustomViewModel.cs
Robert 4ed6d10f38 Nodes - Added IList support
Nodes - Added simple List operator node
2022-08-25 20:34:00 +02:00

27 lines
906 B
C#

using Artemis.Core;
using Artemis.UI.Shared.Services.NodeEditor;
using Artemis.UI.Shared.Services.NodeEditor.Commands;
using Artemis.UI.Shared.VisualScripting;
using ReactiveUI;
namespace Artemis.VisualScripting.Nodes.List.Screens;
public class ListOperatorNodeCustomViewModel : CustomNodeViewModel
{
private readonly ListOperatorNode _node;
private readonly INodeEditorService _nodeEditorService;
public ListOperatorNodeCustomViewModel(ListOperatorNode node, INodeScript script, INodeEditorService nodeEditorService) : base(node, script)
{
_node = node;
_nodeEditorService = nodeEditorService;
NodeModified += (_, _) => this.RaisePropertyChanged(nameof(CurrentValue));
}
public ListOperator CurrentValue
{
get => _node.Storage;
set => _nodeEditorService.ExecuteCommand(Script, new UpdateStorage<ListOperator>(_node, value));
}
}