Click or drag to resize

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
)

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: DualBindingTValue
A 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