IndirectBindingTChildTNewValue 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 IndirectBinding<TNewValue> Child<TNewValue>(
Expression<Func<T, TNewValue>> property
)
Public Function Child(Of TNewValue) (
property As Expression(Of Func(Of T, TNewValue))
) As IndirectBinding(Of TNewValue)
member Child :
property : Expression<Func<'T, 'TNewValue>> -> IndirectBinding<'TNewValue>
Parameters
- property
- Type: System.Linq.ExpressionsExpressionFuncT, TNewValue
Property to bind to.
Type Parameters
- TNewValue
- The type of the child property value.
Return Value
Type:
IndirectBindingTNewValueThe 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; } }
Binding.Property((MyModel m) => m.ChildObject).Child(c => c.SomeChildProperty);
Binding.Property((MyModel m) => m.ChildObject.SomeChildProperty);
See Also