Table of Contents

Class DataModelVisualizationViewModel

Namespace
Artemis.UI.Shared.DataModelVisualization.Shared
Assembly
Artemis.UI.Shared.dll

Represents a base class for a view model that visualizes a part of the data model

public abstract class DataModelVisualizationViewModel : ReactiveObject, IReactiveNotifyPropertyChanged<IReactiveObject>, IHandleObservableErrors, IReactiveObject, IEnableLogger, IDisposable
Inheritance
object
ReactiveObject
DataModelVisualizationViewModel
Implements
IReactiveNotifyPropertyChanged<IReactiveObject>
IHandleObservableErrors
IReactiveObject
IEnableLogger
Derived
Inherited Members
ReactiveObject.SuppressChangeNotifications()
ReactiveObject.AreChangeNotificationsEnabled()
ReactiveObject.DelayChangeNotifications()
ReactiveObject.Changing
ReactiveObject.Changed
ReactiveObject.ThrownExceptions
ReactiveObject.PropertyChanging
ReactiveObject.PropertyChanged

Properties

Children

Gets or sets an observable collection containing the children of this view model

public ObservableCollection<DataModelVisualizationViewModel> Children { get; set; }

Property Value

ObservableCollection<DataModelVisualizationViewModel>

CopyPath

Copies the path of the data model to the clipboard.

public ReactiveCommand<Unit, Unit> CopyPath { get; }

Property Value

ReactiveCommand<Unit, Unit>

DataModel

Gets the data model backing this view model

public DataModel? DataModel { get; protected set; }

Property Value

DataModel

DataModelPath

Gets the data model path to the property this view model is visualizing

public DataModelPath? DataModelPath { get; }

Property Value

DataModelPath

Depth

Gets the property depth of the view model

public int Depth { get; }

Property Value

int

DisplayPath

Gets a user-friendly representation of the DataModelPath

public virtual string? DisplayPath { get; }

Property Value

string

IsMatchingFilteredTypes

Gets a boolean indicating whether the property being visualized matches the types last provided to ApplyTypeFilter(bool, params Type?[]?)

public bool IsMatchingFilteredTypes { get; }

Property Value

bool

IsRootViewModel

Gets a boolean indicating whether this view model is at the root of the data model

public bool IsRootViewModel { get; protected set; }

Property Value

bool

IsVisualizationExpanded

Gets or sets a boolean indicating whether the visualization is expanded, exposing the Children

public bool IsVisualizationExpanded { get; set; }

Property Value

bool

Parent

Gets the parent of this view model

public DataModelVisualizationViewModel? Parent { get; protected set; }

Property Value

DataModelVisualizationViewModel

Path

Gets a string representation of the path backing this model

public string? Path { get; }

Property Value

string

PropertyDescription

Gets the property description of the property this view model is visualizing

public DataModelPropertyAttribute? PropertyDescription { get; protected set; }

Property Value

DataModelPropertyAttribute

Methods

ApplyTypeFilter(bool, params Type?[]?)

Determines whether the provided types match the type of the property being visualized and sets the result in IsMatchingFilteredTypes

public void ApplyTypeFilter(bool looseMatch, params Type?[]? filteredTypes)

Parameters

looseMatch bool

Whether the type may be a loose match, meaning it can be cast or converted

filteredTypes Type[]

The types to filter

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Dispose(bool)

Releases the unmanaged resources used by the object and optionally releases the managed resources.

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

ExpandToPath(DataModelPath)

Expands this view model and any children to expose the provided dataModelPath.

public void ExpandToPath(DataModelPath dataModelPath)

Parameters

dataModelPath DataModelPath

The data model path to expose.

GetCurrentValue()

Gets the current value of the property being visualized

public virtual object? GetCurrentValue()

Returns

object

The current value of the property being visualized

GetSearchResults(string)

Gets the search results for the provided search string

public abstract IEnumerable<DataModelVisualizationViewModel> GetSearchResults(string search)

Parameters

search string

The search string

Returns

IEnumerable<DataModelVisualizationViewModel>

The search results

GetViewModelForPath(DataModelPath)

Finds the view model that hosts the given path.

public DataModelVisualizationViewModel? GetViewModelForPath(DataModelPath dataModelPath)

Parameters

dataModelPath DataModelPath

The path to find

Returns

DataModelVisualizationViewModel

The matching view model, may be null if the path doesn't exist or isn't expanded

OnUpdateRequested()

Invokes the UpdateRequested event

protected virtual void OnUpdateRequested()

Update(IDataModelUIService, DataModelUpdateConfiguration?)

Updates the datamodel and if in an parent, any children

public abstract void Update(IDataModelUIService dataModelUIService, DataModelUpdateConfiguration? configuration)

Parameters

dataModelUIService IDataModelUIService

The data model UI service used during update

configuration DataModelUpdateConfiguration

The configuration to apply while updating

Events

UpdateRequested

Occurs when an update to the property this view model visualizes is requested

public event EventHandler? UpdateRequested

Event Type

EventHandler