ObjectBindingT, TValueBind Method (FuncTValue, ActionTValue, ActionEventHandlerEventArgs, ActionEventHandlerEventArgs, DualBindingMode) |
Namespace:
Eto.Forms
Assembly:
Eto (in Eto.dll) Version: 2.5.3-dev
Syntax public DualBinding<TValue> Bind(
Func<TValue> getValue,
Action<TValue> setValue = null,
Action<EventHandler<EventArgs>> addChangeEvent = null,
Action<EventHandler<EventArgs>> removeChangeEvent = null,
DualBindingMode mode = DualBindingMode.TwoWay
)
Public Function Bind (
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,
Optional mode As DualBindingMode = DualBindingMode.TwoWay
) As DualBinding(Of TValue)
member Bind :
getValue : Func<'TValue> *
?setValue : Action<'TValue> *
?addChangeEvent : Action<EventHandler<EventArgs>> *
?removeChangeEvent : Action<EventHandler<EventArgs>> *
?mode : DualBindingMode
(* Defaults:
let _setValue = defaultArg setValue null
let _addChangeEvent = defaultArg addChangeEvent null
let _removeChangeEvent = defaultArg removeChangeEvent null
let _mode = defaultArg mode DualBindingMode.TwoWay
*)
-> DualBinding<'TValue>
Parameters
- getValue
- Type: SystemFuncTValue
Delegate to get the value. - setValue (Optional)
- Type: SystemActionTValue
Delegate to set the value when changed. - addChangeEvent (Optional)
- Type: SystemActionEventHandlerEventArgs
Delegate to add a change event when the value changes. - removeChangeEvent (Optional)
- Type: SystemActionEventHandlerEventArgs
Delegate to remove the change event. - mode (Optional)
- Type: Eto.FormsDualBindingMode
Dual binding mode.
Return Value
Type:
DualBindingTValue[Missing <returns> documentation for "M:Eto.Forms.ObjectBinding`2.Bind(System.Func{`1},System.Action{`1},System.Action{System.EventHandler{System.EventArgs}},System.Action{System.EventHandler{System.EventArgs}},Eto.Forms.DualBindingMode)"]
Remarks
This creates a
DualBindingT between a new
DelegateBindingTValue and this binding.
This does not require an object instance for the delegates to get/set the value.
You must keep a reference to the binding to unbind when finished.
See Also