Skip to content

Interface IViewBinder

Definition

Namespace: StardewUI.Framework.Binding
Assembly: StardewUI.dll

Service for creating view bindings and their dependencies.

public interface IViewBinder

Members

Methods

Name Description
Bind(IView, IElement, BindingContext, IResolutionScope) Creates a view binding.
GetDescriptor(IView) Retrieves the descriptor for a view, which provides information about its properties.

Details

Methods

Bind(IView, IElement, BindingContext, IResolutionScope)

Creates a view binding.

StardewUI.Framework.Binding.IViewBinding Bind(StardewUI.IView view, StardewUI.Framework.Dom.IElement element, StardewUI.Framework.Binding.BindingContext context, StardewUI.Framework.Content.IResolutionScope resolutionScope);
Parameters

view   IView
The view that will be bound.

element   IElement
The element data providing the literal or binding attributes.

context   BindingContext
The binding context/data, for any non-asset bindings using bindings whose AttributeValueType is one of the recognized IsContextBinding(AttributeValueType) types.

resolutionScope   IResolutionScope
Scope for resolving externalized attributes, such as translation keys.

Returns

IViewBinding

A view binding that can be used to propagate changes in the context or any dependent assets to the view.


GetDescriptor(IView)

Retrieves the descriptor for a view, which provides information about its properties.

StardewUI.Framework.Descriptors.IViewDescriptor GetDescriptor(StardewUI.IView view);
Parameters

view   IView
The view instance.

Returns

IViewDescriptor

The descriptor for the view.

Remarks

Descriptors participate in view binding but may also be used for other purposes, such as updating child lists.