Interface IDataModelUIService
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
RegisteredDataModelEditors
Gets a read-only list of all registered data model editors
IReadOnlyCollection<DataModelVisualizationRegistration> RegisteredDataModelEditors { get; }
Property Value
ShowDataModelValues
Gets a boolean indicating whether or not to show values when displaying data model paths.
PluginSetting<bool> ShowDataModelValues { get; }
Property Value
ShowFullPaths
Gets a boolean indicating whether or not to show full paths when displaying data model paths.
PluginSetting<bool> ShowFullPaths { get; }
Property Value
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
propertyTypeTypeThe type of data model property to find a display view model for
descriptionDataModelPropertyAttributeThe description of the data model property
fallBackToDefaultboolIf 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
propertyTypeTypeThe type of data model property to find a display view model for
descriptionDataModelPropertyAttributeThe description of the data model property
initialValueobjectThe initial value to show in the input
updateCallbackAction<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
modulesList<Module>The modules to create the data model visualization view model for
includeMainDataModelboolWhether 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
pluginPluginThe plugin this display belongs to
Returns
- DataModelVisualizationRegistration
A registration that can be used to remove the display
Type Parameters
TThe 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
pluginPluginThe plugin this editor belongs to
compatibleConversionTypesIReadOnlyCollection<Type>A collection of extra types this editor supports
Returns
- DataModelVisualizationRegistration
A registration that can be used to remove the editor
Type Parameters
TThe type of the editor
RemoveDataModelDisplay(DataModelVisualizationRegistration)
Removes a data model display
void RemoveDataModelDisplay(DataModelVisualizationRegistration registration)
Parameters
registrationDataModelVisualizationRegistrationThe registration of the display as returned by RegisterDataModelDisplay<T>(Plugin)
RemoveDataModelInput(DataModelVisualizationRegistration)
Removes a data model editor
void RemoveDataModelInput(DataModelVisualizationRegistration registration)
Parameters
registrationDataModelVisualizationRegistrationThe 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
mainDataModelVisualizationDataModelPropertiesViewModel