Class VertexGroupViewModel
Represents a collapsible group of vertices (subsystem). When collapsed, all member vertices are hidden and replaced by a single group node. The border colour reflects the aggregate status of all member blocks.
Inherited Members
Namespace: MOSAIC.ViewModels.Graph
Assembly: MOSAIC.dll
Syntax
public class VertexGroupViewModel : ObservableObject, INotifyPropertyChanged, INotifyPropertyChanging
Fields
_statusSubscriptions
Declaration
private readonly List<(INotifyPropertyChanged Source, PropertyChangedEventHandler Handler)> _statusSubscriptions
Field Value
| Type | Description |
|---|---|
| List<(INotifyPropertyChanged Source, PropertyChangedEventHandler Handler)> |
aggregateStatus
The worst BlockStatus across all member blocks. Error > Warning > Normal > Idle. Drives the group node's border colour via StatusToColorConverter.
Declaration
[ObservableProperty]
private BlockStatus aggregateStatus
Field Value
| Type | Description |
|---|---|
| BlockStatus |
height
Declaration
[ObservableProperty]
private float height
Field Value
| Type | Description |
|---|---|
| float |
isSelected
Declaration
[ObservableProperty]
private bool isSelected
Field Value
| Type | Description |
|---|---|
| bool |
name
Declaration
[ObservableProperty]
private string name
Field Value
| Type | Description |
|---|---|
| string |
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
AggregateStatus
The worst BlockStatus across all member blocks. Error > Warning > Normal > Idle. Drives the group node's border colour via StatusToColorConverter.
Declaration
[ExcludeFromCodeCoverage]
public BlockStatus AggregateStatus { get; set; }
Property Value
| Type | Description |
|---|---|
| BlockStatus |
BlockCount
Number of blocks in this group.
Declaration
public int BlockCount { get; }
Property Value
| Type | Description |
|---|---|
| int |
ChildGroups
Child groups contained within this group.
Declaration
public List<VertexGroupViewModel> ChildGroups { get; }
Property Value
| Type | Description |
|---|---|
| List<VertexGroupViewModel> |
ContentSummary
Summary text showing the types of blocks inside.
Declaration
public string ContentSummary { get; }
Property Value
| Type | Description |
|---|---|
| string |
Height
Declaration
[ExcludeFromCodeCoverage]
public float Height { get; set; }
Property Value
| Type | Description |
|---|---|
| float |
IsSelected
Declaration
[ExcludeFromCodeCoverage]
public bool IsSelected { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
MemberBlocks
The actual BaseBlock instances for rendering in the flyout panel via BlockTemplateSelector. Populated when members are added.
Declaration
public ObservableCollection<object> MemberBlocks { get; }
Property Value
| Type | Description |
|---|---|
| ObservableCollection<object> |
Members
The vertices contained in this group.
Declaration
public List<VertexViewModel> Members { get; }
Property Value
| Type | Description |
|---|---|
| List<VertexViewModel> |
Name
Declaration
[ExcludeFromCodeCoverage]
public string Name { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Parent
Parent group (for nested groups). Null if at root level.
Declaration
public VertexGroupViewModel? Parent { get; set; }
Property Value
| Type | Description |
|---|---|
| VertexGroupViewModel |
ProxyVertex
A hidden VertexViewModel that stands in for the group in the edge graph.
Declaration
public VertexViewModel? ProxyVertex { get; set; }
Property Value
| Type | Description |
|---|---|
| VertexViewModel |
SavedPositions
Saved positions of members so they can be restored on ungroup.
Declaration
public Dictionary<VertexViewModel, (float X, float Y)> SavedPositions { get; }
Property Value
| Type | Description |
|---|---|
| Dictionary<VertexViewModel, (float X, float Y)> |
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
OnAggregateStatusChanged(BlockStatus)
Executes the logic for when AggregateStatus just changed.
Declaration
private void OnAggregateStatusChanged(BlockStatus value)
Parameters
| Type | Name | Description |
|---|---|---|
| BlockStatus | value | The new property value that was set. |
Remarks
This method is invoked right after the value of AggregateStatus is changed.
OnAggregateStatusChanged(BlockStatus, BlockStatus)
Executes the logic for when AggregateStatus just changed.
Declaration
private void OnAggregateStatusChanged(BlockStatus oldValue, BlockStatus newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| BlockStatus | oldValue | The previous property value that was replaced. |
| BlockStatus | newValue | The new property value that was set. |
Remarks
This method is invoked right after the value of AggregateStatus is changed.
OnAggregateStatusChanging(BlockStatus)
Executes the logic for when AggregateStatus is changing.
Declaration
private void OnAggregateStatusChanging(BlockStatus value)
Parameters
| Type | Name | Description |
|---|---|---|
| BlockStatus | value | The new property value being set. |
Remarks
This method is invoked right before the value of AggregateStatus is changed.
OnAggregateStatusChanging(BlockStatus, BlockStatus)
Executes the logic for when AggregateStatus is changing.
Declaration
private void OnAggregateStatusChanging(BlockStatus oldValue, BlockStatus newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| BlockStatus | oldValue | The previous property value that is being replaced. |
| BlockStatus | newValue | The new property value being set. |
Remarks
This method is invoked right before the value of AggregateStatus is changed.
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.
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.
OnNameChanged(string)
Executes the logic for when Name just changed.
Declaration
private void OnNameChanged(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The new property value that was set. |
Remarks
This method is invoked right after the value of Name is changed.
OnNameChanged(string?, string)
Executes the logic for when Name just changed.
Declaration
private void OnNameChanged(string? oldValue, string newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| string | oldValue | The previous property value that was replaced. |
| string | newValue | The new property value that was set. |
Remarks
This method is invoked right after the value of Name is changed.
OnNameChanging(string)
Executes the logic for when Name is changing.
Declaration
private void OnNameChanging(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The new property value being set. |
Remarks
This method is invoked right before the value of Name is changed.
OnNameChanging(string?, string)
Executes the logic for when Name is changing.
Declaration
private void OnNameChanging(string? oldValue, string newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| string | oldValue | The previous property value that is being replaced. |
| string | newValue | The new property value being set. |
Remarks
This method is invoked right before the value of Name 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.
RefreshAggregateStatus()
Recomputes AggregateStatus from all member blocks. The worst (most severe) status wins.
Declaration
public void RefreshAggregateStatus()
Severity(BlockStatus)
Severity ranking for each BlockStatus. Higher = more concerning. Stumbling (red) > Lagging (amber) > Normal (green) > Idle (gray).
Declaration
private static int Severity(BlockStatus s)
Parameters
| Type | Name | Description |
|---|---|---|
| BlockStatus | s |
Returns
| Type | Description |
|---|---|
| int |
StartStatusMonitoring()
Subscribes to all member blocks' PropertyChanged to track Status changes. Call once after Members are populated.
Declaration
public void StartStatusMonitoring()
StopStatusMonitoring()
Unsubscribes from all member block status change events.
Declaration
public void StopStatusMonitoring()
SyncProxyPosition()
Keeps the proxy vertex position in sync with the group.
Declaration
public void SyncProxyPosition()