Click or drag to resize

BindableBindingT, TValueBindDataContextTObject Method (ExpressionFuncTObject, TValue, DualBindingMode)

Binds to a specified property of the control's current data context.

Namespace:  Eto.Forms
Assembly:  Eto (in Eto.dll) Version: 2.5.3-dev
Syntax
public DualBinding<TValue> BindDataContext<TObject>(
	Expression<Func<TObject, TValue>> propertyExpression,
	DualBindingMode mode = DualBindingMode.TwoWay
)

Parameters

propertyExpression
Type: System.Linq.ExpressionsExpressionFuncTObject, TValue
Expression for a property of the data context, or a non-property expression with no change event binding.
mode (Optional)
Type: Eto.FormsDualBindingMode
Direction of the binding

Type Parameters

TObject
Type of the data context to bind to

Return Value

Type: DualBindingTValue
The binding between the data context and this binding
Remarks
This has the advantage of registering automatically to INotifyPropertyChanged or to an event named after the property with a "Changed" suffix, if the expression is a property. When the expression does not evaluate to a property, it will not be able to bind to the changed events and will use the expression as a delegate directly.
See Also