Class ViewNodeFactory
Definition
Namespace: StardewUI.Framework.Binding
Assembly: StardewUI.dll
Default in-game view engine.
Inheritance
Object ⇦ ViewNodeFactory
Implements
IViewNodeFactory
Members
Constructors
| Name | Description |
|---|---|
| ViewNodeFactory(IViewFactory, IValueSourceFactory, IValueConverterFactory, IViewBinder, IAssetCache, IResolutionScopeFactory, IBehaviorFactory) | Default in-game view engine. |
Methods
| Name | Description |
|---|---|
| CreateNode(Document) | Creates a bound view node, and all descendants, from the root of a parsed Document. |
| CreateNode(SNode, IReadOnlyList<INodeTransformer>, IResolutionScope) | Creates a bound view node, and all descendants, from parsed node data. |
Details
Constructors
ViewNodeFactory(IViewFactory, IValueSourceFactory, IValueConverterFactory, IViewBinder, IAssetCache, IResolutionScopeFactory, IBehaviorFactory)
Default in-game view engine.
public ViewNodeFactory(StardewUI.Framework.Binding.IViewFactory viewFactory, StardewUI.Framework.Sources.IValueSourceFactory valueSourceFactory, StardewUI.Framework.Converters.IValueConverterFactory valueConverterFactory, StardewUI.Framework.Binding.IViewBinder viewBinder, StardewUI.Framework.Content.IAssetCache assetCache, StardewUI.Framework.Content.IResolutionScopeFactory resolutionScopeFactory, StardewUI.Framework.Behaviors.IBehaviorFactory behaviorFactory);
Parameters
viewFactory IViewFactory
Factory for creating views, based on their tag names.
valueSourceFactory IValueSourceFactory
The factory responsible for creating IValueSource<T> instances from attribute data.
valueConverterFactory IValueConverterFactory
The factory responsible for creating IValueConverter<TSource, TDestination> instances, used to convert bound values to the types required by the target view or structural property.
viewBinder IViewBinder
Binding service used to create IViewBinding instances that detect changes to data or assets and propagate them to the bound IView.
assetCache IAssetCache
Cache for obtaining document assets. Used for included views.
resolutionScopeFactory IResolutionScopeFactory
Factory for creating IResolutionScope instances responsible for resolving external symbols such as translation keys.
behaviorFactory IBehaviorFactory
Factory for creating behavior extensions.
Methods
CreateNode(Document)
Creates a bound view node, and all descendants, from the root of a parsed Document.
Parameters
document Document
The markup document.
Returns
An IViewNode providing the IView bound with the node's attributes and children, which automatically applies changes on each Update(TimeSpan).
Remarks
This method automatically infers the correct IResolutionScope, so it does not require an explicit scope to be given.
CreateNode(SNode, IReadOnlyList<INodeTransformer>, IResolutionScope)
Creates a bound view node, and all descendants, from parsed node data.
public StardewUI.Framework.Binding.IViewNode CreateNode(StardewUI.Framework.Dom.SNode node, System.Collections.Generic.IReadOnlyList<StardewUI.Framework.Dom.INodeTransformer> nodeTransformers, StardewUI.Framework.Content.IResolutionScope resolutionScope);
Parameters
node SNode
The node data.
nodeTransformers IReadOnlyList<INodeTransformer>
Transformers to run on each document node before using it to create a runtime (bound) view node.
resolutionScope IResolutionScope
Scope for resolving externalized attributes, such as translation keys.
Returns
An IViewNode providing the IView bound with the node's attributes and children, which automatically applies changes on each Update(TimeSpan).