Click or drag to resize

ObjectBindingT, TValueBindTObject Method (TObject, ExpressionFuncTObject, TValue, DualBindingMode)

Creates a binding to the specified objectValue with the specified propertyExpression.

Namespace:  Eto.Forms
Assembly:  Eto (in Eto.dll) Version: 2.4.0
public DualBinding<TValue> Bind<TObject>(
	TObject objectValue,
	Expression<Func<TObject, TValue>> propertyExpression,
	DualBindingMode mode = DualBindingMode.TwoWay


Type: TObject
Object to bind to.
Type: System.Linq.ExpressionsExpressionFuncTObject, TValue
Expression for a property of the objectValue, or a non-property expression with no change event binding.
mode (Optional)
Type: Eto.FormsDualBindingMode
Direction of the binding

Type Parameters

Type of the data context to bind to

Return Value

Type: DualBindingTValue
The binding between the data context and this binding
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