Class ConvertedValueSource
Definition
Namespace: StardewUI.Framework.Sources
Assembly: StardewUI.dll
Helpers for creating instances of the generic ConvertedValueSource<TSource, T> when some of the types are unknown at compile time.
Inheritance
Object ⇦ ConvertedValueSource
Members
Methods
Name | Description |
---|---|
Create(IValueSource, Type, IValueConverterFactory, Boolean) | Creates a converted source with a specified output type, using an original source with unknown value type. |
Create<T>(IValueSource, IValueConverterFactory, Boolean) | Creates a converted source with a specified output type, using an original source with unknown value type. |
Details
Methods
Create(IValueSource, Type, IValueConverterFactory, bool)
Creates a converted source with a specified output type, using an original source with unknown value type.
public static StardewUI.Framework.Sources.IValueSource Create(StardewUI.Framework.Sources.IValueSource original, System.Type destinationType, StardewUI.Framework.Converters.IValueConverterFactory converterFactory, bool twoWay);
Parameters
original
IValueSource
The original value source.
destinationType
Type
The type to convert to.
converterFactory
IValueConverterFactory
Factory for creating instances of IValueConverter<TSource, TDestination>.
twoWay
Boolean
Whether the resulting IValueSource should be able to convert in the reverse direction, i.e. for two-way bindings, by setting Value.
Returns
Create<T>(IValueSource, IValueConverterFactory, bool)
Creates a converted source with a specified output type, using an original source with unknown value type.
public static StardewUI.Framework.Sources.IValueSource<T> Create<T>(StardewUI.Framework.Sources.IValueSource original, StardewUI.Framework.Converters.IValueConverterFactory converterFactory, bool twoWay);
Parameters
original
IValueSource
The original value source.
converterFactory
IValueConverterFactory
Factory for creating instances of IValueConverter<TSource, TDestination>.
twoWay
Boolean
Whether the resulting IValueSource should be able to convert in the reverse direction, i.e. for two-way bindings, by setting Value.