Skip to content

Class ReflectionViewBinder

Definition

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

An IViewBinder implementation using reflected view descriptors.

public class ReflectionViewBinder : StardewUI.Framework.Binding.IViewBinder

Inheritance
Object ⇦ ReflectionViewBinder

Implements
IViewBinder

Members

Constructors

Name Description
ReflectionViewBinder(IAttributeBindingFactory, IEventBindingFactory) An IViewBinder implementation using reflected view descriptors.

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

Constructors

ReflectionViewBinder(IAttributeBindingFactory, IEventBindingFactory)

An IViewBinder implementation using reflected view descriptors.

public ReflectionViewBinder(StardewUI.Framework.Binding.IAttributeBindingFactory attributeBindingFactory, StardewUI.Framework.Binding.IEventBindingFactory eventBindingFactory);
Parameters

attributeBindingFactory   IAttributeBindingFactory
Factory for creating the IAttributeBinding instances used to bind individual attributes of the view.

eventBindingFactory   IEventBindingFactory
Factory for creating the IEventBinding instances used to bind events raised by the view.


Methods

Bind(IView, IElement, BindingContext, IResolutionScope)

Creates a view binding.

public 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.

public 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.