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.
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.
Property Value
Descriptor
Descriptor of the Data type, used to read current values.
Property Value
EqualityContract
Property Value
Parent
The parent context from which this context was derived, if any.
Property Value
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
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
The resolved BindingContext, or null
if the redirect
does not resolve to a valid context.