Skip to content

Class ValueConverter<TSource, TDestination>

Definition

Namespace: StardewUI.Framework.Converters
Assembly: StardewUI.dll

Generic delegating converter, accepting a conversion function.

public class ValueConverter<TSource, TDestination> : 
    StardewUI.Framework.Converters.IValueConverter<TSource, TDestination>, 
    StardewUI.Framework.Converters.IValueConverter

Type Parameters

TSource
The type of value to be converted.

TDestination
The converted value type.

Inheritance
Object ⇦ ValueConverter<TSource, TDestination>

Implements
IValueConverter<TSource, TDestination>, IValueConverter

Members

Constructors

Name Description
ValueConverter<TSource, TDestination>(Func<TSource, TDestination>) Generic delegating converter, accepting a conversion function.

Methods

Name Description
Convert(TSource) Converts a value from the source type to the destination type.

Details

Constructors

ValueConverter<TSource, TDestination>(Func<TSource, TDestination>)

Generic delegating converter, accepting a conversion function.

public ValueConverter<TSource, TDestination>(Func<TSource, TDestination> convert);
Parameters

convert   Func<TSource, TDestination>
Function to convert a TSource to a TDestination.


Methods

Convert(TSource)

Converts a value from the source type to the destination type.

public TDestination Convert(TSource value);
Parameters

value   TSource
The value to convert.

Returns

TDestination