Click or drag to resize

DirectBindingTToTypeTType Method

Uses System.Convert.ChangeType to change the value of the binding to the specified type.

Namespace:  Eto.Forms
Assembly:  Eto (in Eto.dll) Version: 2.5.3-dev
Syntax
public DirectBinding<TType> ToType<TType>(
	Func<T, TType> invalidGetValue = null,
	Func<TType, T> invalidSetValue = null
)

Parameters

invalidGetValue (Optional)
Type: SystemFuncT, TType
Delegate to get a value when it cannot be converted to the specified TType. When null, an exception will be thrown when the value cannot be converted.
invalidSetValue (Optional)
Type: SystemFuncTType, T
Delegate to set a value when it cannot be converted from the specified TType. When null, an exception will be thrown when the value cannot be converted.

Type Parameters

TType
Type to convert the value to

Return Value

Type: DirectBindingTType
A binding of the new type that is a converted version of this binding
Remarks
This has additional logic to deal with nullable types so they can be converted properly as well.
See Also