IndirectBindingTToTypeTType 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 IndirectBinding<TType> ToType<TType>(
Func<T, TType> invalidGetValue = null,
Func<TType, T> invalidSetValue = null
)
Public Function ToType(Of TType) (
Optional invalidGetValue As Func(Of T, TType) = Nothing,
Optional invalidSetValue As Func(Of TType, T) = Nothing
) As IndirectBinding(Of TType)
member ToType :
?invalidGetValue : Func<'T, 'TType> *
?invalidSetValue : Func<'TType, 'T>
(* Defaults:
let _invalidGetValue = defaultArg invalidGetValue null
let _invalidSetValue = defaultArg invalidSetValue null
*)
-> IndirectBinding<'TType>
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:
IndirectBindingTTypeA 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