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
)
Public Function BindDataContext(Of TObject) (
propertyExpression As Expression(Of Func(Of TObject, TValue)),
Optional mode As DualBindingMode = DualBindingMode.TwoWay
) As DualBinding(Of TValue)
member BindDataContext :
propertyExpression : Expression<Func<'TObject, 'TValue>> *
?mode : DualBindingMode
(* Defaults:
let _mode = defaultArg mode DualBindingMode.TwoWay
*)
-> DualBinding<'TValue>
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:
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