Class VertexViewModel

A base class for objects of which the properties must be observable.

Inheritance
VertexViewModel
Namespace: MOSAIC.ViewModels.Graph
Assembly: MOSAIC.dll
Syntax
public class VertexViewModel : ObservableObject, INotifyPropertyChanged, INotifyPropertyChanging

Constructors

VertexViewModel(BaseBlock)

Declaration
public VertexViewModel(BaseBlock block)
Parameters
Type Name Description
BaseBlock block

Fields

height

Declaration
[ObservableProperty]
private float height
Field Value
Type Description
float

isDropCompatible

True while a palette drag is over the canvas and this block can connect with the dragged type.

Declaration
[ObservableProperty]
private bool isDropCompatible
Field Value
Type Description
bool

isSelected

Declaration
[ObservableProperty]
private bool isSelected
Field Value
Type Description
bool

width

Declaration
[ObservableProperty]
private float width
Field Value
Type Description
float

x

Declaration
[ObservableProperty]
private float x
Field Value
Type Description
float

y

Declaration
[ObservableProperty]
private float y
Field Value
Type Description
float

Properties

AcceptsSummary

Friendly list of accepted upstream block types (from AllowableBlocks), or "any block".

Declaration
public string AcceptsSummary { get; }
Property Value
Type Description
string

ArityBadge

Compact "connected / capacity" badge shown on the node.

Declaration
public string ArityBadge { get; }
Property Value
Type Description
string

Category

Declaration
public BlockCategory Category { get; }
Property Value
Type Description
BlockCategory

ConnectedInputs

Inputs currently wired (one neighbour = one input edge).

Declaration
public int ConnectedInputs { get; }
Property Value
Type Description
int

Constraints

Declaration
private BlockConstraints.Inputs Constraints { get; }
Property Value
Type Description
BlockConstraints.Inputs

HasOutput

Every BaseBlock is an IPublisher, so it always exposes an output port.

Declaration
public bool HasOutput { get; }
Property Value
Type Description
bool

Height

Declaration
[ExcludeFromCodeCoverage]
public float Height { get; set; }
Property Value
Type Description
float

InputPortCount

Number of input port slots to draw: 0 for sources; exactly MaxInputs for bounded blocks; for unbounded blocks (e.g. Joiner) the connected count plus one spare "add" slot.

Declaration
public int InputPortCount { get; }
Property Value
Type Description
int

InputPortCountOverride

When set, overrides the reflected input-port count. Used by group edge-routing proxies, which aggregate many external inputs and don't follow any single block's constraints.

Declaration
public int? InputPortCountOverride { get; set; }
Property Value
Type Description
int?

InputPorts

Per-slot input port states, left-to-top order (connected first, then required, then optional).

Declaration
public IReadOnlyList<InputPortInfo> InputPorts { get; }
Property Value
Type Description
IReadOnlyList<InputPortInfo>

InputSummaryText

Human-readable input requirement, for the node's info popup.

Declaration
public string InputSummaryText { get; }
Property Value
Type Description
string

IsDropCompatible

True while a palette drag is over the canvas and this block can connect with the dragged type.

Declaration
[ExcludeFromCodeCoverage]
public bool IsDropCompatible { get; set; }
Property Value
Type Description
bool

IsSelected

Declaration
[ExcludeFromCodeCoverage]
public bool IsSelected { get; set; }
Property Value
Type Description
bool

IsSource

True when the block takes no inputs and can originate a stream.

Declaration
public bool IsSource { get; }
Property Value
Type Description
bool

MaxInputs

Declaration
public int MaxInputs { get; }
Property Value
Type Description
int

MinInputs

Declaration
public int MinInputs { get; }
Property Value
Type Description
int

MissingInputs

Declaration
public int MissingInputs { get; }
Property Value
Type Description
int

NeedsMoreInputs

Declaration
public bool NeedsMoreInputs { get; }
Property Value
Type Description
bool

NeedsText

Declaration
public string NeedsText { get; }
Property Value
Type Description
string

Neighbors

Upstream blocks feeding this one — each neighbour is one input edge.

Declaration
public List<VertexViewModel> Neighbors { get; }
Property Value
Type Description
List<VertexViewModel>

Value

Declaration
public BaseBlock Value { get; }
Property Value
Type Description
BaseBlock

Width

Declaration
[ExcludeFromCodeCoverage]
public float Width { get; set; }
Property Value
Type Description
float

X

Declaration
[ExcludeFromCodeCoverage]
public float X { get; set; }
Property Value
Type Description
float

Y

Declaration
[ExcludeFromCodeCoverage]
public float Y { get; set; }
Property Value
Type Description
float

Methods

NotifyInputsChanged()

Raise change notifications for every input-derived read-only property. Call after mutating Neighbors so the node's ports, badge, and popup refresh (used from Phase 2 wiring).

Declaration
public void NotifyInputsChanged()

OnHeightChanged(float)

Executes the logic for when Height just changed.

Declaration
private void OnHeightChanged(float value)
Parameters
Type Name Description
float value

The new property value that was set.

Remarks

This method is invoked right after the value of Height is changed.

OnHeightChanged(float, float)

Executes the logic for when Height just changed.

Declaration
private void OnHeightChanged(float oldValue, float newValue)
Parameters
Type Name Description
float oldValue

The previous property value that was replaced.

float newValue

The new property value that was set.

Remarks

This method is invoked right after the value of Height is changed.

OnHeightChanging(float)

Executes the logic for when Height is changing.

Declaration
private void OnHeightChanging(float value)
Parameters
Type Name Description
float value

The new property value being set.

Remarks

This method is invoked right before the value of Height is changed.

OnHeightChanging(float, float)

Executes the logic for when Height is changing.

Declaration
private void OnHeightChanging(float oldValue, float newValue)
Parameters
Type Name Description
float oldValue

The previous property value that is being replaced.

float newValue

The new property value being set.

Remarks

This method is invoked right before the value of Height is changed.

OnIsDropCompatibleChanged(bool)

Executes the logic for when IsDropCompatible just changed.

Declaration
private void OnIsDropCompatibleChanged(bool value)
Parameters
Type Name Description
bool value

The new property value that was set.

Remarks

This method is invoked right after the value of IsDropCompatible is changed.

OnIsDropCompatibleChanged(bool, bool)

Executes the logic for when IsDropCompatible just changed.

Declaration
private void OnIsDropCompatibleChanged(bool oldValue, bool newValue)
Parameters
Type Name Description
bool oldValue

The previous property value that was replaced.

bool newValue

The new property value that was set.

Remarks

This method is invoked right after the value of IsDropCompatible is changed.

OnIsDropCompatibleChanging(bool)

Executes the logic for when IsDropCompatible is changing.

Declaration
private void OnIsDropCompatibleChanging(bool value)
Parameters
Type Name Description
bool value

The new property value being set.

Remarks

This method is invoked right before the value of IsDropCompatible is changed.

OnIsDropCompatibleChanging(bool, bool)

Executes the logic for when IsDropCompatible is changing.

Declaration
private void OnIsDropCompatibleChanging(bool oldValue, bool newValue)
Parameters
Type Name Description
bool oldValue

The previous property value that is being replaced.

bool newValue

The new property value being set.

Remarks

This method is invoked right before the value of IsDropCompatible is changed.

OnIsSelectedChanged(bool)

Executes the logic for when IsSelected just changed.

Declaration
private void OnIsSelectedChanged(bool value)
Parameters
Type Name Description
bool value

The new property value that was set.

Remarks

This method is invoked right after the value of IsSelected is changed.

OnIsSelectedChanged(bool, bool)

Executes the logic for when IsSelected just changed.

Declaration
private void OnIsSelectedChanged(bool oldValue, bool newValue)
Parameters
Type Name Description
bool oldValue

The previous property value that was replaced.

bool newValue

The new property value that was set.

Remarks

This method is invoked right after the value of IsSelected is changed.

OnIsSelectedChanging(bool)

Executes the logic for when IsSelected is changing.

Declaration
private void OnIsSelectedChanging(bool value)
Parameters
Type Name Description
bool value

The new property value being set.

Remarks

This method is invoked right before the value of IsSelected is changed.

OnIsSelectedChanging(bool, bool)

Executes the logic for when IsSelected is changing.

Declaration
private void OnIsSelectedChanging(bool oldValue, bool newValue)
Parameters
Type Name Description
bool oldValue

The previous property value that is being replaced.

bool newValue

The new property value being set.

Remarks

This method is invoked right before the value of IsSelected is changed.

OnWidthChanged(float)

Executes the logic for when Width just changed.

Declaration
private void OnWidthChanged(float value)
Parameters
Type Name Description
float value

The new property value that was set.

Remarks

This method is invoked right after the value of Width is changed.

OnWidthChanged(float, float)

Executes the logic for when Width just changed.

Declaration
private void OnWidthChanged(float oldValue, float newValue)
Parameters
Type Name Description
float oldValue

The previous property value that was replaced.

float newValue

The new property value that was set.

Remarks

This method is invoked right after the value of Width is changed.

OnWidthChanging(float)

Executes the logic for when Width is changing.

Declaration
private void OnWidthChanging(float value)
Parameters
Type Name Description
float value

The new property value being set.

Remarks

This method is invoked right before the value of Width is changed.

OnWidthChanging(float, float)

Executes the logic for when Width is changing.

Declaration
private void OnWidthChanging(float oldValue, float newValue)
Parameters
Type Name Description
float oldValue

The previous property value that is being replaced.

float newValue

The new property value being set.

Remarks

This method is invoked right before the value of Width is changed.

OnXChanged(float)

Executes the logic for when X just changed.

Declaration
private void OnXChanged(float value)
Parameters
Type Name Description
float value

The new property value that was set.

Remarks

This method is invoked right after the value of X is changed.

OnXChanged(float, float)

Executes the logic for when X just changed.

Declaration
private void OnXChanged(float oldValue, float newValue)
Parameters
Type Name Description
float oldValue

The previous property value that was replaced.

float newValue

The new property value that was set.

Remarks

This method is invoked right after the value of X is changed.

OnXChanging(float)

Executes the logic for when X is changing.

Declaration
private void OnXChanging(float value)
Parameters
Type Name Description
float value

The new property value being set.

Remarks

This method is invoked right before the value of X is changed.

OnXChanging(float, float)

Executes the logic for when X is changing.

Declaration
private void OnXChanging(float oldValue, float newValue)
Parameters
Type Name Description
float oldValue

The previous property value that is being replaced.

float newValue

The new property value being set.

Remarks

This method is invoked right before the value of X is changed.

OnYChanged(float)

Executes the logic for when Y just changed.

Declaration
private void OnYChanged(float value)
Parameters
Type Name Description
float value

The new property value that was set.

Remarks

This method is invoked right after the value of Y is changed.

OnYChanged(float, float)

Executes the logic for when Y just changed.

Declaration
private void OnYChanged(float oldValue, float newValue)
Parameters
Type Name Description
float oldValue

The previous property value that was replaced.

float newValue

The new property value that was set.

Remarks

This method is invoked right after the value of Y is changed.

OnYChanging(float)

Executes the logic for when Y is changing.

Declaration
private void OnYChanging(float value)
Parameters
Type Name Description
float value

The new property value being set.

Remarks

This method is invoked right before the value of Y is changed.

OnYChanging(float, float)

Executes the logic for when Y is changing.

Declaration
private void OnYChanging(float oldValue, float newValue)
Parameters
Type Name Description
float oldValue

The previous property value that is being replaced.

float newValue

The new property value being set.

Remarks

This method is invoked right before the value of Y is changed.

Implements

INotifyPropertyChanged
INotifyPropertyChanging

Search documentation

Start typing to search the documentation.