Skip to content

Class CastingValueConverterFactory

Definition

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

Factory that automatically implements casting conversions, where the source type can be assigned directly to the destination type.

public class CastingValueConverterFactory : 
    StardewUI.Framework.Converters.IValueConverterFactory

Inheritance
Object ⇦ CastingValueConverterFactory

Implements
IValueConverterFactory

Members

Constructors

Name Description
CastingValueConverterFactory()

Methods

Name Description
TryGetConverter<TSource, TDestination>(IValueConverter<TSource, TDestination>) Attempts to obtain a converter from a given source type to a given destination type.

Details

Constructors

CastingValueConverterFactory()

public CastingValueConverterFactory();

Methods

TryGetConverter<TSource, TDestination>(IValueConverter<TSource, TDestination>)

Attempts to obtain a converter from a given source type to a given destination type.

public bool TryGetConverter<TSource, TDestination>(out IValueConverter<TSource, TDestination> converter);
Parameters

converter   IValueConverter<TSource, TDestination>
If the method returns true, holds the converter that converts between the specified types; otherwise null.

Returns

Boolean

true if the conversion is supported, otherwise false.