Skip to content

Class BindingContext

Definition

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

Context, or scope, of a bound view, providing the backing data and tools for accessing its properties.

public record BindingContext : 
    IEquatable<StardewUI.Framework.Binding.BindingContext>

Inheritance
Object ⇦ BindingContext

Implements
IEquatable<BindingContext>

Members

Constructors

Name Description
BindingContext(IObjectDescriptor, Object, BindingContext) Context, or scope, of a bound view, providing the backing data and tools for accessing its properties.

Properties

Name Description
Data The bound data.
Descriptor Descriptor of the Data type, used to read current values.
EqualityContract
Parent The parent context from which this context was derived, if any.

Methods

Name Description
Create(Object, BindingContext) Creates a BindingContext from the specified data, automatically building a new descriptor if the data type has not been previously seen.
Redirect(ContextRedirect) Resolves a redirected context, using this context as the starting point.

Details

Constructors

BindingContext(IObjectDescriptor, Object, BindingContext)

Context, or scope, of a bound view, providing the backing data and tools for accessing its properties.

public BindingContext(StardewUI.Framework.Descriptors.IObjectDescriptor Descriptor, System.Object Data, StardewUI.Framework.Binding.BindingContext Parent);
Parameters

Descriptor   IObjectDescriptor
Descriptor of the Data type, used to read current values.

Data   Object
The bound data.

Parent   BindingContext
The parent context from which this context was derived, if any.


Properties

Data

The bound data.

public System.Object Data { get; set; }
Property Value

Object


Descriptor

Descriptor of the Data type, used to read current values.

public StardewUI.Framework.Descriptors.IObjectDescriptor Descriptor { get; set; }
Property Value

IObjectDescriptor


EqualityContract

protected System.Type EqualityContract { get; }
Property Value

Type


Parent

The parent context from which this context was derived, if any.

public StardewUI.Framework.Binding.BindingContext Parent { get; set; }
Property Value

BindingContext


Methods

Create(Object, BindingContext)

Creates a BindingContext from the specified data, automatically building a new descriptor if the data type has not been previously seen.

public static StardewUI.Framework.Binding.BindingContext Create(System.Object data, StardewUI.Framework.Binding.BindingContext parent);
Parameters

data   Object
The bound data.

parent   BindingContext
The parent context from which this context was derived, if any.

Returns

BindingContext

A new BindingContext whose Data is the specified data and whose Descriptor is the descriptor of data's runtime type.


Redirect(ContextRedirect)

Resolves a redirected context, using this context as the starting point.

public StardewUI.Framework.Binding.BindingContext Redirect(StardewUI.Framework.Dom.ContextRedirect redirect);
Parameters

redirect   ContextRedirect
The redirect data.

Returns

BindingContext

The resolved BindingContext, or null if the redirect does not resolve to a valid context.