Class ViewFactory
Definition
Namespace: StardewUI.Framework.Binding
Assembly: StardewUI.dll
A view factory based on per-tag delegates. Can be used as a base class for other view factories.
Inheritance
Object ⇦ ViewFactory
Implements
IViewFactory
Members
Constructors
| Name | Description |
|---|---|
| ViewFactory() |
Methods
| Name | Description |
|---|---|
| CreateView(string) | Creates a new view. |
| Register<TView>(string) | Registers a view for a given tag using the view's default parameterless constructor. |
| Register(string, Func<IView>) | Registers a view for a given tag using a delegate function. |
| SupportsTag(string) | Checks if the factory can create views corresponding to a specific tag. |
Details
Constructors
ViewFactory()
Methods
CreateView(string)
Creates a new view.
Parameters
tagName string
The markup tag that specifies the type of view.
Returns
A new view of a type corresponding to the tagName.
Register<TView>(string)
Registers a view for a given tag using the view's default parameterless constructor.
Parameters
tagName string
The markup tag corresponding to the TView type.
Register(string, Func<IView>)
Registers a view for a given tag using a delegate function.
Parameters
tagName string
The markup tag to handle.
tagFactory Func<IView>
Delegate function to create the view corresponding to the tagName.
SupportsTag(string)
Checks if the factory can create views corresponding to a specific tag.
Parameters
tagName string
The markup tag that specifies the type of view.
Returns
true if this factory should handle the specified tagName, otherwise false.