Skip to content

Interface IValueSourceFactory

Definition

Namespace: StardewUI.Framework.Sources
Assembly: StardewUI.dll

Provides methods to look up runtime value types and build appropriate sources based on their binding information.

public interface IValueSourceFactory

Members

Methods

Name Description
GetValueSource(Type, IArgument, BindingContext) Creates a value source that supplies values of a given type according to the specified argument binding.
GetValueSource(Type, IAttribute, BindingContext, IResolutionScope) Creates a value source that supplies values of a given type according to the specified binding attribute.
GetValueSource<T>(IArgument, BindingContext) Creates a value source that supplies values according to the specified argument binding.
GetValueSource<T>(IAttribute, BindingContext, IResolutionScope) Creates a value source that supplies values according to the specified binding attribute.
GetValueType(IArgument, BindingContext) Determines the type of value that will be supplied by a given argument binding, and with the specified context.
GetValueType(IAttribute, IPropertyDescriptor, BindingContext) Determines the type of value that will be supplied by a given attribute binding, and with the specified context.

Details

Methods

GetValueSource(Type, IArgument, BindingContext)

Creates a value source that supplies values of a given type according to the specified argument binding.

StardewUI.Framework.Sources.IValueSource GetValueSource(System.Type type, StardewUI.Framework.Dom.IArgument argument, StardewUI.Framework.Binding.BindingContext context);
Parameters

type   Type
The type of value to obtain; can be determined using GetValueType(IArgument, BindingContext).

argument   IArgument
The parsed markup argument containing the binding info.

context   BindingContext
The binding context to use for any contextual bindings (those with ContextBinding).

Returns

IValueSource


GetValueSource(Type, IAttribute, BindingContext, IResolutionScope)

Creates a value source that supplies values of a given type according to the specified binding attribute.

StardewUI.Framework.Sources.IValueSource GetValueSource(System.Type type, StardewUI.Framework.Dom.IAttribute attribute, StardewUI.Framework.Binding.BindingContext context, StardewUI.Framework.Content.IResolutionScope scope);
Parameters

type   Type
The type of value to obtain; can be determined using GetValueType(IArgument, BindingContext).

attribute   IAttribute
The parsed markup attribute containing the binding info.

context   BindingContext
The binding context to use for any contextual bindings (those with ContextBinding).

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

Returns

IValueSource


GetValueSource<T>(IArgument, BindingContext)

Creates a value source that supplies values according to the specified argument binding.

StardewUI.Framework.Sources.IValueSource<T> GetValueSource<T>(StardewUI.Framework.Dom.IArgument argument, StardewUI.Framework.Binding.BindingContext context);
Parameters

argument   IArgument
The parsed markup argument containing the binding info.

context   BindingContext
The binding context to use for any contextual bindings (those with InputBinding, OneTimeBinding, OutputBinding or TwoWayBinding).

Returns

IValueSource<T>


GetValueSource<T>(IAttribute, BindingContext, IResolutionScope)

Creates a value source that supplies values according to the specified binding attribute.

StardewUI.Framework.Sources.IValueSource<T> GetValueSource<T>(StardewUI.Framework.Dom.IAttribute attribute, StardewUI.Framework.Binding.BindingContext context, StardewUI.Framework.Content.IResolutionScope scope);
Parameters

attribute   IAttribute
The parsed markup attribute containing the binding info.

context   BindingContext
The binding context to use for any contextual bindings (those with InputBinding, OneTimeBinding, OutputBinding or TwoWayBinding).

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

Returns

IValueSource<T>


GetValueType(IArgument, BindingContext)

Determines the type of value that will be supplied by a given argument binding, and with the specified context.

System.Type GetValueType(StardewUI.Framework.Dom.IArgument argument, StardewUI.Framework.Binding.BindingContext context);
Parameters

argument   IArgument
The parsed markup argument containing the binding info.

context   BindingContext
The binding context to use for any contextual bindings (those with ContextBinding).

Returns

Type

Remarks

This provides the type argument that must be supplied to GetValueSource(Type, IArgument, BindingContext).


GetValueType(IAttribute, IPropertyDescriptor, BindingContext)

Determines the type of value that will be supplied by a given attribute binding, and with the specified context.

System.Type GetValueType(StardewUI.Framework.Dom.IAttribute attribute, StardewUI.Framework.Descriptors.IPropertyDescriptor property, StardewUI.Framework.Binding.BindingContext context);
Parameters

attribute   IAttribute
The parsed markup attribute containing the binding info.

property   IPropertyDescriptor
Binding metadata for the destination property; used when the source does not encode any independent type information. If not specified, some attribute values may be unsupported.

context   BindingContext
The binding context to use for any contextual bindings (those with InputBinding, OneTimeBinding, OutputBinding or TwoWayBinding).

Returns

Type

Remarks

This provides the type argument that must be supplied to GetValueSource(Type, IArgument, BindingContext).