Class ControlFactory
Creates the controls of a view from the models read from its view file.
public class ControlFactory : IControlFactory
- Inheritance
-
ControlFactory
- Implements
- Inherited Members
Constructors
ControlFactory(ILogger, ITextureModelLoader, IThemeResourceStore)
Creates the factory. Created by dependency injection.
public ControlFactory(ILogger logger, ITextureModelLoader textureModelLoader, IThemeResourceStore themeResourceStore)
Parameters
loggerILoggertextureModelLoaderITextureModelLoaderthemeResourceStoreIThemeResourceStore
Methods
Create(View, Control, string)
Builds any control from its model - the one place that maps a schema element to a runtime control.
public UIElement Create(View view, Control model, string containerDescription = null)
Parameters
Returns
Remarks
There used to be a hand-written copy of this switch in each container (stack, grid cell, dock), and they had silently drifted: the grid's threw NotSupportedException rather than warning, and omitted CheckBox and RadioButton entirely, so putting a checkbox in a grid cell took the whole view down. One dispatcher means a new element type becomes available everywhere at once, which is also what lets a repeater's item template hold anything a layout can.
Create(View, Decoration)
Creates a Decoration from its view-file model.
public Decoration Create(View view, Decoration model)
Parameters
viewViewmodelDecoration
Returns
Create(View, DockLayout)
Creates a DockLayout from its view-file model.
public DockLayout Create(View view, DockLayout model)
Parameters
viewViewmodelDockLayout
Returns
Create(View, GridLayout)
Creates a Grid from its view-file grid model.
public Grid Create(View view, GridLayout model)
Parameters
viewViewmodelGridLayout
Returns
Create(View, Label)
Creates a Label from its view-file model.
public Label Create(View view, Label model)
Parameters
Returns
Create(View, StackLayout)
Creates a StackLayout from its view-file model.
public StackLayout Create(View view, StackLayout model)
Parameters
viewViewmodelStackLayout
Returns
Create(ILogger, View, Button)
Creates a Button from its view-file model.
public Button Create(ILogger logger, View view, Button model)
Parameters
Returns
Create(ILogger, View, CheckBox)
Creates a CheckBox from its view-file model.
public CheckBox Create(ILogger logger, View view, CheckBox model)
Parameters
Returns
Create(ILogger, View, ComboBox)
Creates a ComboBox from its view-file model.
public ComboBox Create(ILogger logger, View view, ComboBox model)
Parameters
Returns
Create(ILogger, View, Image)
Creates an ImageControl from its view-file model.
public ImageControl Create(ILogger logger, View view, Image model)
Parameters
Returns
Create(ILogger, View, PasswordBox)
Creates a TextBox that hides its text, from its view-file password box model.
public TextBox Create(ILogger logger, View view, PasswordBox model)
Parameters
loggerILoggerviewViewmodelPasswordBox
Returns
Create(ILogger, View, ProgressBar)
Creates a ProgressBar from its view-file model.
public ProgressBar Create(ILogger logger, View view, ProgressBar model)
Parameters
loggerILoggerviewViewmodelProgressBar
Returns
Create(ILogger, View, RadioButton)
Creates a RadioButton from its view-file model.
public RadioButton Create(ILogger logger, View view, RadioButton model)
Parameters
loggerILoggerviewViewmodelRadioButton
Returns
Create(ILogger, View, Repeater)
Creates a Repeater from its view-file model.
public Repeater Create(ILogger logger, View view, Repeater model)
Parameters
Returns
Create(ILogger, View, Slider)
Creates a Slider from its view-file model.
public Slider Create(ILogger logger, View view, Slider model)
Parameters
Returns
Create(ILogger, View, TextBox)
Creates a TextBox from its view-file model.
public TextBox Create(ILogger logger, View view, TextBox model)