Click or drag to resize

BindableExtensionsBindDataContextTWidget, TValue Method (TWidget, ExpressionFuncTWidget, TValue, IndirectBindingTValue, DualBindingMode, TValue, TValue)

Binds a control property to a DataContext property

Namespace:  Eto.Forms
Assembly:  Eto (in Eto.dll) Version: 2.5.3-dev
public static DualBinding<TValue> BindDataContext<TWidget, TValue>(
	this TWidget control,
	Expression<Func<TWidget, TValue>> controlProperty,
	IndirectBinding<TValue> sourceBinding,
	DualBindingMode mode = DualBindingMode.TwoWay,
	TValue defaultControlValue = null,
	TValue defaultContextValue = null
where TWidget : IBindable


Type: TWidget
Control to bind to.
Type: System.Linq.ExpressionsExpressionFuncTWidget, TValue
Control property.
Type: Eto.FormsIndirectBindingTValue
Source binding to get/set the value on the data context.
mode (Optional)
Type: Eto.FormsDualBindingMode
Mode of the binding.
defaultControlValue (Optional)
Type: TValue
Default control value, if the control value is null.
defaultContextValue (Optional)
Type: TValue
Default context value, if the context value is null.

Type Parameters

The type of control.
The type of the property.

Return Value

Type: DualBindingTValue

[Missing <returns> documentation for "M:Eto.Forms.BindableExtensions.BindDataContext``2(``0,System.Linq.Expressions.Expression{System.Func{``0,``1}},Eto.Forms.IndirectBinding{``1},Eto.Forms.DualBindingMode,``1,``1)"]

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type . 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