Table of Contents

Interface IDataModelUIService

Namespace
Artemis.UI.Shared.Services
Assembly
Artemis.UI.Shared.dll

A service for UI related data model tasks

public interface IDataModelUIService : IArtemisSharedUIService

Properties

RegisteredDataModelDisplays

Gets a read-only list of all registered data model displays

IReadOnlyCollection<DataModelVisualizationRegistration> RegisteredDataModelDisplays { get; }

Property Value

IReadOnlyCollection<DataModelVisualizationRegistration>

RegisteredDataModelEditors

Gets a read-only list of all registered data model editors

IReadOnlyCollection<DataModelVisualizationRegistration> RegisteredDataModelEditors { get; }

Property Value

IReadOnlyCollection<DataModelVisualizationRegistration>

ShowDataModelValues

Gets a boolean indicating whether or not to show values when displaying data model paths.

PluginSetting<bool> ShowDataModelValues { get; }

Property Value

PluginSetting<bool>

ShowFullPaths

Gets a boolean indicating whether or not to show full paths when displaying data model paths.

PluginSetting<bool> ShowFullPaths { get; }

Property Value

PluginSetting<bool>

Methods

GetDataModelDisplayViewModel(Type, DataModelPropertyAttribute?, bool)

Creates the most appropriate display view model for the provided propertyType that can display a value

DataModelDisplayViewModel? GetDataModelDisplayViewModel(Type propertyType, DataModelPropertyAttribute? description, bool fallBackToDefault = false)

Parameters

propertyType Type

The type of data model property to find a display view model for

description DataModelPropertyAttribute

The description of the data model property

fallBackToDefault bool

If true, a simple .ToString() display view model will be returned if nothing else is found

Returns

DataModelDisplayViewModel

The most appropriate display view model for the provided propertyType

GetDataModelInputViewModel(Type, DataModelPropertyAttribute?, object?, Action<object?, bool>)

Creates the most appropriate input view model for the provided propertyType that allows inputting a value

DataModelInputViewModel? GetDataModelInputViewModel(Type propertyType, DataModelPropertyAttribute? description, object? initialValue, Action<object?, bool> updateCallback)

Parameters

propertyType Type

The type of data model property to find a display view model for

description DataModelPropertyAttribute

The description of the data model property

initialValue object

The initial value to show in the input

updateCallback Action<object, bool>

A function to call whenever the input was updated (submitted or not)

Returns

DataModelInputViewModel

The most appropriate input view model for the provided propertyType

GetMainDataModelVisualization()

Creates a data model visualization view model for the main data model

DataModelPropertiesViewModel GetMainDataModelVisualization()

Returns

DataModelPropertiesViewModel

A data model visualization view model containing all data model expansions and modules that expand the main data model

GetPluginDataModelVisualization(List<Module>, bool)

Creates a data model visualization view model for the data model of the provided plugin feature

DataModelPropertiesViewModel? GetPluginDataModelVisualization(List<Module> modules, bool includeMainDataModel)

Parameters

modules List<Module>

The modules to create the data model visualization view model for

includeMainDataModel bool

Whether or not also to include the main data model (and therefore any modules marked as IsAlwaysAvailable)

Returns

DataModelPropertiesViewModel

A data model visualization view model containing the data model of the provided feature

RegisterDataModelDisplay<T>(Plugin)

Registers a new data model display

DataModelVisualizationRegistration RegisterDataModelDisplay<T>(Plugin plugin) where T : DataModelDisplayViewModel

Parameters

plugin Plugin

The plugin this display belongs to

Returns

DataModelVisualizationRegistration

A registration that can be used to remove the display

Type Parameters

T

The type of the display

RegisterDataModelInput<T>(Plugin, IReadOnlyCollection<Type>)

Registers a new data model editor

DataModelVisualizationRegistration RegisterDataModelInput<T>(Plugin plugin, IReadOnlyCollection<Type> compatibleConversionTypes) where T : DataModelInputViewModel

Parameters

plugin Plugin

The plugin this editor belongs to

compatibleConversionTypes IReadOnlyCollection<Type>

A collection of extra types this editor supports

Returns

DataModelVisualizationRegistration

A registration that can be used to remove the editor

Type Parameters

T

The type of the editor

RemoveDataModelDisplay(DataModelVisualizationRegistration)

Removes a data model display

void RemoveDataModelDisplay(DataModelVisualizationRegistration registration)

Parameters

registration DataModelVisualizationRegistration

The registration of the display as returned by RegisterDataModelDisplay<T>(Plugin)

RemoveDataModelInput(DataModelVisualizationRegistration)

Removes a data model editor

void RemoveDataModelInput(DataModelVisualizationRegistration registration)

Parameters

registration DataModelVisualizationRegistration

The registration of the editor as returned by RegisterDataModelInput<T>(Plugin, IReadOnlyCollection<Type>)

UpdateModules(DataModelPropertiesViewModel)

Updates the children of the provided main data model visualization, removing disabled children and adding newly enabled children

void UpdateModules(DataModelPropertiesViewModel mainDataModelVisualization)

Parameters

mainDataModelVisualization DataModelPropertiesViewModel