Click or drag to resize

DirectBindingTChildTValue Method (ExpressionFuncT, TValue)

Binds to the specified child property expression.

Namespace:  Eto.Forms
Assembly:  Eto (in Eto.dll) Version: 2.5.3-dev
public DirectBinding<TValue> Child<TValue>(
	Expression<Func<T, TValue>> property


Type: System.Linq.ExpressionsExpressionFuncT, TValue
Property to bind to.

Type Parameters

The type of the child property value.

Return Value

Type: DirectBindingTValue
The binding to the child property accessed through the current binding.
This can be used to bind to properties of child objects of your view model, for example
. 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.
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