DirectBindingTChildTValue Method (ExpressionFuncT, TValue) |
Binds to the specified child property expression.
Namespace:
Eto.Forms
Assembly:
Eto (in Eto.dll) Version: 2.5.3-dev
Syntax public DirectBinding<TValue> Child<TValue>(
Expression<Func<T, TValue>> property
)
Public Function Child(Of TValue) (
property As Expression(Of Func(Of T, TValue))
) As DirectBinding(Of TValue)
member Child :
property : Expression<Func<'T, 'TValue>> -> DirectBinding<'TValue>
Parameters
- property
- Type: System.Linq.ExpressionsExpressionFuncT, TValue
Property to bind to.
Type Parameters
- TValue
- The type of the child property value.
Return Value
Type:
DirectBindingTValueThe binding to the child property accessed through the current binding.
Remarks
This can be used to bind to properties of child objects of your view model, for example
model.SomeProperty.ChildProperty
.
This will automatically look up the changed event either by a [Property]Changed event or INotifyPropertyChanged implementation
for each object in the heirarchy.
Note that you only really need to use this when you have an existing binding that you cannot change.
See
PropertyT, TValue(ExpressionFuncT, TValue) for an example of how to bind to child property values
more directly.
Examples
Use this like so:
public class MyChild { public SomeChildProperty { get; set; } }
public class MyModel { public ChildObject { get; set; } }
var model = new MyModel();
Binding.Property(model, (MyModel m) => m.ChildObject).Child(c => c.SomeChildProperty);
See Also