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.5.3-dev
Syntax public DualBinding<TValue> Bind<TObject>(
TObject objectValue,
Expression<Func<TObject, TValue>> propertyExpression,
DualBindingMode mode = DualBindingMode.TwoWay
)
Public Function Bind(Of TObject) (
objectValue As TObject,
propertyExpression As Expression(Of Func(Of TObject, TValue)),
Optional mode As DualBindingMode = DualBindingMode.TwoWay
) As DualBinding(Of TValue)
member Bind :
objectValue : 'TObject *
propertyExpression : Expression<Func<'TObject, 'TValue>> *
?mode : DualBindingMode
(* Defaults:
let _mode = defaultArg mode DualBindingMode.TwoWay
*)
-> DualBinding<'TValue>
Parameters
- objectValue
- Type: TObject
Object to bind to. - propertyExpression
- 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
- TObject
- Type of the data context to bind to
Return Value
Type:
DualBindingTValueThe 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