Class NodeInputViewModel
Viewmodel class for inputs on a node. Inputs are endpoints that can only be connected to outputs.
Inheritance
Implements
Inherited Members
Namespace: NodeNetwork.ViewModels
Assembly: NodeNetwork.dll
Syntax
public class NodeInputViewModel : Endpoint, IReactiveNotifyPropertyChanged<IReactiveObject>, IHandleObservableErrors, IReactiveObject, INotifyPropertyChanged, INotifyPropertyChanging, IEnableLogger
Constructors
| Improve this Doc View SourceNodeInputViewModel()
Declaration
public NodeInputViewModel()
Properties
| Improve this Doc View SourceConnectionValidator
This function is called when a new connection with this input is pending. It decides whether or not the pending connection is valid. If the validation result says the pending connection is invalid, then the user will not be able to add the connection to the network.
Declaration
public Func<PendingConnectionViewModel, ConnectionValidationResult> ConnectionValidator { get; set; }
Property Value
Type | Description |
---|---|
System.Func<PendingConnectionViewModel, ConnectionValidationResult> |
HideEditorIfConnected
If true, the editor of this input will be hidden if Connection is not null. This makes sense if the editor is used to provide a value when no connection is present.
Declaration
public bool HideEditorIfConnected { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
IsEditorVisible
If true, the editor is visible. Otherwise, the editor is hidden. See HideEditorIfConnected.
Declaration
public bool IsEditorVisible { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceCreatePendingConnection()
Sets the pending connection in the network to a new connection with this endpoint as the input. If this input already is connected, and MaxConnections == 1, then the connection is replaced by a pending connection without this endpoint. If the connection would be invalid, no pending connection is made. Called when the user clicks on this endpoint.
Declaration
protected override void CreatePendingConnection()
Overrides
| Improve this Doc View SourceFinishPendingConnection()
Tries to create a new connection in the network based on the pending connection and this endpoint as the input. If the connection would be invalid, no connection is made. The pending connection is deleted. Called when the user drags and releases a pending connection over this endpoint.
Declaration
protected override void FinishPendingConnection()
Overrides
| Improve this Doc View SourceSetConnectionPreview(Boolean)
Sets this endpoint as the input of the pending connection and updates its validation. Called when the user drags and holds a pending connection over this endpoint.
Declaration
protected override void SetConnectionPreview(bool previewActive)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | previewActive | True to set this endpoint as the output of the pending connection. To remove this endpoint from the pending connection, set this to false. |