DelegateConverterFactory.CreateValueConverter<TIn, TOut>(Func<TIn, TOut>, Func<TOut, TIn>) Method

Creates an instance of an object that implements the IValueConverter interface.

Namespace: DevExpress.Mvvm.UI

Assembly: DevExpress.Xpf.Core.v20.1.dll

Declaration

public static IValueConverter CreateValueConverter<TIn, TOut>(
    Func<TIn, TOut> convert,
    Func<TOut, TIn> convertBack = null
)
Public Shared Function CreateValueConverter(Of TIn, TOut)(
    convert As Func(Of TIn, TOut),
    convertBack As Func(Of TOut, TIn) = Nothing
) As IValueConverter

Parameters

Name Type Description
convert Func<TIn, TOut>

A delegate method that converts a value.

Optional Parameters

Name Type Default Description
convertBack Func<TOut, TIn>

null

A delegate method that converts a value back.

Type Parameters

Name Description
TIn

The type of the value produced by the binding source.

TOut

The type of the value of the binding target.

Returns

Type Description
IValueConverter

An instance of an object that implements the IValueConverter interface.

See Also