Click or drag to resize

BindableExtensionsBindDataContextT Method (IBindable, IndirectBindingT, IndirectBindingT, DualBindingMode, T, T)

Adds a new binding from the control to its data context

Namespace:  Eto.Forms
Assembly:  Eto (in Eto.dll) Version: 2.5.3-dev
Syntax
public static DualBinding<T> BindDataContext<T>(
	this IBindable bindable,
	IndirectBinding<T> controlBinding,
	IndirectBinding<T> dataContextBinding,
	DualBindingMode mode = DualBindingMode.TwoWay,
	T defaultControlValue = null,
	T defaultContextValue = null
)

Parameters

bindable
Type: Eto.FormsIBindable
Bindable object to add the binding to
controlBinding
Type: Eto.FormsIndirectBindingT
Binding to get/set the value from the control.
dataContextBinding
Type: Eto.FormsIndirectBindingT
Binding to get/set the value from the DataContext.
mode (Optional)
Type: Eto.FormsDualBindingMode
Mode of the binding.
defaultControlValue (Optional)
Type: T
Default control value to set to the objectValue, if the value of the control property is null.
defaultContextValue (Optional)
Type: T
Default context value to set to the control, if the objectValue or value of the objectBinding is null.

Type Parameters

T

[Missing <typeparam name="T"/> documentation for "M:Eto.Forms.BindableExtensions.BindDataContext``1(Eto.Forms.IBindable,Eto.Forms.IndirectBinding{``0},Eto.Forms.IndirectBinding{``0},Eto.Forms.DualBindingMode,``0,``0)"]

Return Value

Type: DualBindingT

[Missing <returns> documentation for "M:Eto.Forms.BindableExtensions.BindDataContext``1(Eto.Forms.IBindable,Eto.Forms.IndirectBinding{``0},Eto.Forms.IndirectBinding{``0},Eto.Forms.DualBindingMode,``0,``0)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IBindable. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
See Also