Click or drag to resize

BindingPropertyT, TValue Method (ExpressionFuncT, TValue)

Creates a new indirect property binding using the specified propertyExpression.

Namespace:  Eto.Forms
Assembly:  Eto (in Eto.dll) Version: 2.5.3-dev
Syntax
public static IndirectBinding<TValue> Property<T, TValue>(
	Expression<Func<T, TValue>> propertyExpression
)

Parameters

propertyExpression
Type: System.Linq.ExpressionsExpressionFuncT, TValue
Expression of the property to bind to.

Type Parameters

T
The type of the model.
TValue
The property value type.

Return Value

Type: IndirectBindingTValue

[Missing <returns> documentation for "M:Eto.Forms.Binding.Property``2(System.Linq.Expressions.Expression{System.Func{``0,``1}})"]

Remarks
This supports single and multiple levels of property accessors in the model.
Examples
Use this like so:
public class MyChild { public SomeChildProperty { get; set; } }
public class MyModel { 
    public ChildObject { get; set; } 
    public int IntProperty { get; set; } 
}

// direct property binding
Binding.Property((MyModel m) => m.IntProperty);

// bind to a property of a child object of the view model
Binding.Property((MyModel m) => m.ChildObject.SomeChildProperty);
See Also