BindingDelegateTValue Method (FuncTValue, ActionTValue, ActionEventHandlerEventArgs, ActionEventHandlerEventArgs) |
Creates a new direct delegate binding.
Namespace:
Eto.Forms
Assembly:
Eto (in Eto.dll) Version: 2.5.3-dev
Syntax public static DirectBinding<TValue> Delegate<TValue>(
Func<TValue> getValue,
Action<TValue> setValue = null,
Action<EventHandler<EventArgs>> addChangeEvent = null,
Action<EventHandler<EventArgs>> removeChangeEvent = null
)
Public Shared Function Delegate(Of TValue) (
getValue As Func(Of TValue),
Optional setValue As Action(Of TValue) = Nothing,
Optional addChangeEvent As Action(Of EventHandler(Of EventArgs)) = Nothing,
Optional removeChangeEvent As Action(Of EventHandler(Of EventArgs)) = Nothing
) As DirectBinding(Of TValue)
static member Delegate :
getValue : Func<'TValue> *
?setValue : Action<'TValue> *
?addChangeEvent : Action<EventHandler<EventArgs>> *
?removeChangeEvent : Action<EventHandler<EventArgs>>
(* Defaults:
let _setValue = defaultArg setValue null
let _addChangeEvent = defaultArg addChangeEvent null
let _removeChangeEvent = defaultArg removeChangeEvent null
*)
-> DirectBinding<'TValue>
Parameters
- getValue
- Type: SystemFuncTValue
Delegate to get the value for the binding. - setValue (Optional)
- Type: SystemActionTValue
Delegate to set the value for the binding. - addChangeEvent (Optional)
- Type: SystemActionEventHandlerEventArgs
Delegate to register the change event, when needed by the consumer of this binding. - removeChangeEvent (Optional)
- Type: SystemActionEventHandlerEventArgs
Delegate to remove the change event.
Type Parameters
- TValue
[Missing <typeparam name="TValue"/> documentation for "M:Eto.Forms.Binding.Delegate``1(System.Func{``0},System.Action{``0},System.Action{System.EventHandler{System.EventArgs}},System.Action{System.EventHandler{System.EventArgs}})"]
Return Value
Type:
DirectBindingTValue[Missing <returns> documentation for "M:Eto.Forms.Binding.Delegate``1(System.Func{``0},System.Action{``0},System.Action{System.EventHandler{System.EventArgs}},System.Action{System.EventHandler{System.EventArgs}})"]
See Also