Interface IDataModelUIService
A service for UI related data model tasks
Namespace: Artemis.UI.Shared.Services
Assembly: Artemis.UI.Shared.dll
Syntax
public interface IDataModelUIService : IArtemisSharedUIService
Properties
RegisteredDataModelDisplays
Gets a read-only list of all registered data model displays
Declaration
IReadOnlyCollection<DataModelVisualizationRegistration> RegisteredDataModelDisplays { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<DataModelVisualizationRegistration> |
RegisteredDataModelEditors
Gets a read-only list of all registered data model editors
Declaration
IReadOnlyCollection<DataModelVisualizationRegistration> RegisteredDataModelEditors { get; }
Property Value
Type | Description |
---|---|
IReadOnlyCollection<DataModelVisualizationRegistration> |
Methods
GetDataModelDisplayViewModel(Type, DataModelPropertyAttribute?, bool)
Creates the most appropriate display view model for the provided propertyType
that can display
a value
Declaration
DataModelDisplayViewModel? GetDataModelDisplayViewModel(Type propertyType, DataModelPropertyAttribute? description, bool fallBackToDefault = false)
Parameters
Type | Name | Description |
---|---|---|
Type | propertyType | The type of data model property to find a display view model for |
DataModelPropertyAttribute | description | The description of the data model property |
bool | fallBackToDefault | If true, a simple .ToString() display view model will be returned if nothing else is found |
Returns
Type | Description |
---|---|
DataModelDisplayViewModel | The most appropriate display view model for the provided |
GetDataModelInputViewModel(Type, DataModelPropertyAttribute?, object?, Action<object?, bool>)
Creates the most appropriate input view model for the provided propertyType
that allows
inputting a value
Declaration
DataModelInputViewModel? GetDataModelInputViewModel(Type propertyType, DataModelPropertyAttribute? description, object? initialValue, Action<object?, bool> updateCallback)
Parameters
Type | Name | Description |
---|---|---|
Type | propertyType | The type of data model property to find a display view model for |
DataModelPropertyAttribute | description | The description of the data model property |
object | initialValue | The initial value to show in the input |
Action<object, bool> | updateCallback | A function to call whenever the input was updated (submitted or not) |
Returns
Type | Description |
---|---|
DataModelInputViewModel | The most appropriate input view model for the provided |
GetMainDataModelVisualization()
Creates a data model visualization view model for the main data model
Declaration
DataModelPropertiesViewModel GetMainDataModelVisualization()
Returns
Type | Description |
---|---|
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
Declaration
DataModelPropertiesViewModel? GetPluginDataModelVisualization(List<Module> modules, bool includeMainDataModel)
Parameters
Type | Name | Description |
---|---|---|
List<Module> | modules | The modules to create the data model visualization view model for |
bool | includeMainDataModel | Whether or not also to include the main data model (and therefore any modules marked as IsAlwaysAvailable) |
Returns
Type | Description |
---|---|
DataModelPropertiesViewModel | A data model visualization view model containing the data model of the provided feature |
RegisterDataModelDisplay<T>(Plugin)
Registers a new data model display
Declaration
DataModelVisualizationRegistration RegisterDataModelDisplay<T>(Plugin plugin) where T : DataModelDisplayViewModel
Parameters
Type | Name | Description |
---|---|---|
Plugin | plugin | The plugin this display belongs to |
Returns
Type | Description |
---|---|
DataModelVisualizationRegistration | A registration that can be used to remove the display |
Type Parameters
Name | Description |
---|---|
T | The type of the display |
RegisterDataModelInput<T>(Plugin, IReadOnlyCollection<Type>)
Registers a new data model editor
Declaration
DataModelVisualizationRegistration RegisterDataModelInput<T>(Plugin plugin, IReadOnlyCollection<Type> compatibleConversionTypes) where T : DataModelInputViewModel
Parameters
Type | Name | Description |
---|---|---|
Plugin | plugin | The plugin this editor belongs to |
IReadOnlyCollection<Type> | compatibleConversionTypes | A collection of extra types this editor supports |
Returns
Type | Description |
---|---|
DataModelVisualizationRegistration | A registration that can be used to remove the editor |
Type Parameters
Name | Description |
---|---|
T | The type of the editor |
RemoveDataModelDisplay(DataModelVisualizationRegistration)
Removes a data model display
Declaration
void RemoveDataModelDisplay(DataModelVisualizationRegistration registration)
Parameters
Type | Name | Description |
---|---|---|
DataModelVisualizationRegistration | registration | The registration of the display as returned by RegisterDataModelDisplay<T>(Plugin) |
RemoveDataModelInput(DataModelVisualizationRegistration)
Removes a data model editor
Declaration
void RemoveDataModelInput(DataModelVisualizationRegistration registration)
Parameters
Type | Name | Description |
---|---|---|
DataModelVisualizationRegistration | registration | 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
Declaration
void UpdateModules(DataModelPropertiesViewModel mainDataModelVisualization)
Parameters
Type | Name | Description |
---|---|---|
DataModelPropertiesViewModel | mainDataModelVisualization |