Click or drag to resize

BindableBindingT, TValueChildTNewValue Method (ExpressionFuncT, TNewValue)

Binds to the specified child property expression.

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

Parameters

property
Type: System.Linq.ExpressionsExpressionFuncT, TNewValue
Property to bind to.

Type Parameters

TNewValue
The type of the child property value.

Return Value

Type: BindableBindingT, TNewValue
The 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