using PixiEditor.AvaloniaUI.Models.Commands.Attributes.Commands; using PixiEditor.AvaloniaUI.Models.Handlers; using PixiEditor.Numerics; namespace PixiEditor.AvaloniaUI.ViewModels.SubViewModels; internal class NodeGraphManagerViewModel : SubViewModel { public NodeGraphManagerViewModel(ViewModelMain owner) : base(owner) { } [Command.Internal("PixiEditor.NodeGraph.CreateNode")] public void CreateNode(Type nodeType) { Owner.DocumentManagerSubViewModel.ActiveDocument?.NodeGraph.CreateNode(nodeType); } [Command.Internal("PixiEditor.NodeGraph.ChangeNodePos")] public void ChangeNodePos((INodeHandler node, VecD newPos) args) { Owner.DocumentManagerSubViewModel.ActiveDocument?.NodeGraph.SetNodePosition(args.node, args.newPos); } [Command.Internal("PixiEditor.NodeGraph.EndChangeNodePos")] public void EndChangeNodePos() { Owner.DocumentManagerSubViewModel.ActiveDocument?.NodeGraph.EndChangeNodePosition(); } }