Class DataModelVisualizationViewModel
Represents a base class for a view model that visualizes a part of the data model
Inheritance
Implements
Inherited Members
Namespace: Artemis.UI.Shared.DataModelVisualization.Shared
Assembly: Artemis.UI.Shared.dll
Syntax
public abstract class DataModelVisualizationViewModel : ReactiveObject, IReactiveNotifyPropertyChanged<IReactiveObject>, IHandleObservableErrors, IReactiveObject, IEnableLogger, IDisposable
Properties
Children
Gets or sets an observable collection containing the children of this view model
Declaration
public ObservableCollection<DataModelVisualizationViewModel> Children { get; set; }
Property Value
| Type | Description |
|---|---|
| ObservableCollection<DataModelVisualizationViewModel> |
CopyPath
Copies the path of the data model to the clipboard.
Declaration
public ReactiveCommand<Unit, Unit> CopyPath { get; }
Property Value
| Type | Description |
|---|---|
| ReactiveCommand<Unit, Unit> |
DataModel
Gets the data model backing this view model
Declaration
public DataModel? DataModel { get; protected set; }
Property Value
| Type | Description |
|---|---|
| DataModel |
DataModelPath
Gets the data model path to the property this view model is visualizing
Declaration
public DataModelPath? DataModelPath { get; }
Property Value
| Type | Description |
|---|---|
| DataModelPath |
Depth
Gets the property depth of the view model
Declaration
public int Depth { get; }
Property Value
| Type | Description |
|---|---|
| int |
DisplayPath
Gets a user-friendly representation of the DataModelPath
Declaration
public virtual string? DisplayPath { get; }
Property Value
| Type | Description |
|---|---|
| string |
IsMatchingFilteredTypes
Gets a boolean indicating whether the property being visualized matches the types last provided to ApplyTypeFilter(bool, params Type?[]?)
Declaration
public bool IsMatchingFilteredTypes { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsRootViewModel
Gets a boolean indicating whether this view model is at the root of the data model
Declaration
public bool IsRootViewModel { get; protected set; }
Property Value
| Type | Description |
|---|---|
| bool |
IsVisualizationExpanded
Gets or sets a boolean indicating whether the visualization is expanded, exposing the Children
Declaration
public bool IsVisualizationExpanded { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Parent
Gets the parent of this view model
Declaration
public DataModelVisualizationViewModel? Parent { get; protected set; }
Property Value
| Type | Description |
|---|---|
| DataModelVisualizationViewModel |
Path
Gets a string representation of the path backing this model
Declaration
public string? Path { get; }
Property Value
| Type | Description |
|---|---|
| string |
PropertyDescription
Gets the property description of the property this view model is visualizing
Declaration
public DataModelPropertyAttribute? PropertyDescription { get; protected set; }
Property Value
| Type | Description |
|---|---|
| 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
Declaration
public void ApplyTypeFilter(bool looseMatch, params Type?[]? filteredTypes)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | looseMatch | Whether the type may be a loose match, meaning it can be cast or converted |
| Type[] | filteredTypes | The types to filter |
Dispose()
Declaration
public void Dispose()
Dispose(bool)
Releases the unmanaged resources used by the object and optionally releases the managed resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | disposing | 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.
Declaration
public void ExpandToPath(DataModelPath dataModelPath)
Parameters
| Type | Name | Description |
|---|---|---|
| DataModelPath | dataModelPath | The data model path to expose. |
GetCurrentValue()
Gets the current value of the property being visualized
Declaration
public virtual object? GetCurrentValue()
Returns
| Type | Description |
|---|---|
| object | The current value of the property being visualized |
GetViewModelForPath(DataModelPath)
Finds the view model that hosts the given path.
Declaration
public DataModelVisualizationViewModel? GetViewModelForPath(DataModelPath dataModelPath)
Parameters
| Type | Name | Description |
|---|---|---|
| DataModelPath | dataModelPath | The path to find |
Returns
| Type | Description |
|---|---|
| DataModelVisualizationViewModel | The matching view model, may be null if the path doesn't exist or isn't expanded |
OnUpdateRequested()
Invokes the UpdateRequested event
Declaration
protected virtual void OnUpdateRequested()
Update(IDataModelUIService, DataModelUpdateConfiguration?)
Updates the datamodel and if in an parent, any children
Declaration
public abstract void Update(IDataModelUIService dataModelUIService, DataModelUpdateConfiguration? configuration)
Parameters
| Type | Name | Description |
|---|---|---|
| IDataModelUIService | dataModelUIService | The data model UI service used during update |
| DataModelUpdateConfiguration | configuration | The configuration to apply while updating |
Events
UpdateRequested
Occurs when an update to the property this view model visualizes is requested
Declaration
public event EventHandler? UpdateRequested
Event Type
| Type | Description |
|---|---|
| EventHandler |