BindableBindingT, TValueBindDataContext Method (IndirectBindingTValue, DualBindingMode, TValue, TValue) |
Binds to an object's
DataContext using the specified
dataContextBinding.
Namespace:
Eto.Forms
Assembly:
Eto (in Eto.dll) Version: 2.5.3-dev
Syntax public DualBinding<TValue> BindDataContext(
IndirectBinding<TValue> dataContextBinding,
DualBindingMode mode = DualBindingMode.TwoWay,
TValue defaultControlValue = null,
TValue defaultContextValue = null
)
Public Function BindDataContext (
dataContextBinding As IndirectBinding(Of TValue),
Optional mode As DualBindingMode = DualBindingMode.TwoWay,
Optional defaultControlValue As TValue = Nothing,
Optional defaultContextValue As TValue = Nothing
) As DualBinding(Of TValue)
member BindDataContext :
dataContextBinding : IndirectBinding<'TValue> *
?mode : DualBindingMode *
?defaultControlValue : 'TValue *
?defaultContextValue : 'TValue
(* Defaults:
let _mode = defaultArg mode DualBindingMode.TwoWay
let _defaultControlValue = defaultArg defaultControlValue null
let _defaultContextValue = defaultArg defaultContextValue null
*)
-> DualBinding<'TValue>
Parameters
- dataContextBinding
- Type: Eto.FormsIndirectBindingTValue
Binding to get/set values from/to the control's data context. - mode (Optional)
- Type: Eto.FormsDualBindingMode
Dual binding mode. - defaultControlValue (Optional)
- Type: TValue
Default control value. - defaultContextValue (Optional)
- Type: TValue
Default context value.
Return Value
Type:
DualBindingTValueA new dual binding that binds the
dataContextBinding to this control binding.
Remarks
This creates a
DualBindingT between a binding to the specified
dataContextBinding and this binding.
Since the data context changes, the binding passed for the data context binding is an indirect binding, in that it is reused.
The binding is added to the
Bindings collection.
See Also