using System; using System.Collections.Generic; using System.Linq; using System.Reactive.Linq; using System.Text; using System.Threading.Tasks; using DynamicData; using ExampleCodeGenApp.Model; using ExampleCodeGenApp.Model.Compiler; using ExampleCodeGenApp.ViewModels.Editors; using ExampleCodeGenApp.Views; using NodeNetwork.Toolkit.ValueNode; using ReactiveUI; namespace ExampleCodeGenApp.ViewModels.Nodes { public class TextLiteralNode : CodeGenNodeViewModel { static TextLiteralNode() { Splat.Locator.CurrentMutable.Register(() => new CodeGenNodeView(), typeof(IViewFor)); } public StringValueEditorViewModel ValueEditor { get; } = new StringValueEditorViewModel(); public ValueNodeOutputViewModel> Output { get; } public TextLiteralNode() : base(NodeType.Literal) { this.Name = "Text"; Output = new CodeGenOutputViewModel>(PortType.String) { Name = "Value", Editor = ValueEditor, Value = ValueEditor.ValueChanged.Select(v => new StringLiteral{ Value = v }) }; this.Outputs.Add(Output); } } }