DirectBindingTConvertTValue Method |
Converts this binding's value to another value using delegates.
Namespace:
Eto.Forms
Assembly:
Eto (in Eto.dll) Version: 2.5.3-dev
Syntax public DirectBinding<TValue> Convert<TValue>(
Func<T, TValue> toValue,
Func<TValue, T> fromValue = null
)
Public Function Convert(Of TValue) (
toValue As Func(Of T, TValue),
Optional fromValue As Func(Of TValue, T) = Nothing
) As DirectBinding(Of TValue)
member Convert :
toValue : Func<'T, 'TValue> *
?fromValue : Func<'TValue, 'T>
(* Defaults:
let _fromValue = defaultArg fromValue null
*)
-> DirectBinding<'TValue>
Parameters
- toValue
- Type: SystemFuncT, TValue
Delegate to convert to the new value type. - fromValue (Optional)
- Type: SystemFuncTValue, T
Delegate to convert from the value to the original binding's type.
Type Parameters
- TValue
- Type of the value for the new binding
Return Value
Type:
DirectBindingTValueA new binding with the specified
TValue type.
Remarks
This is useful when you want to cast one binding to another, perform logic when getting/setting a value from a particular
binding, or get/set a preoperty of the value.
See Also