using DynamicData; using NodeNetwork.Toolkit.ValueNode; using NodeNetwork.ViewModels; using NodeNetwork.Views; using ReactiveUI; namespace ExampleCalculatorApp.ViewModels.Nodes { public class ConstantNodeViewModel : NodeViewModel { static ConstantNodeViewModel() { Splat.Locator.CurrentMutable.Register(() => new NodeView(), typeof(IViewFor)); } public IntegerValueEditorViewModel ValueEditor { get; } = new IntegerValueEditorViewModel(); public ValueNodeOutputViewModel Output { get; } public ConstantNodeViewModel() { this.Name = "Constant"; Output = new ValueNodeOutputViewModel { Name = "Value", Editor = ValueEditor, Value = this.WhenAnyValue(vm => vm.ValueEditor.Value) }; this.Outputs.Add(Output); } } }