Click or drag to resize

BindableExtensionsBindDataContextTWidget, TContext, TValue Method (TWidget, ExpressionFuncTWidget, TValue, ExpressionFuncTContext, TValue, 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, TContext, TValue>(
	this TWidget control,
	Expression<Func<TWidget, TValue>> controlProperty,
	Expression<Func<TContext, TValue>> sourceProperty,
	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: System.Linq.ExpressionsExpressionFuncTContext, TValue
Source property from 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 data context object.
The type of the property.

Return Value

Type: DualBindingTValue

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

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