MetadataBuilder<T>.Property<TProperty>(Expression<Func<T, TProperty>>) Method
Initializes a property metadata builder.
Namespace: DevExpress.Mvvm.DataAnnotations
Assembly: DevExpress.Mvvm.v24.1.dll
NuGet Packages: DevExpress.Mvvm, DevExpress.Win.Navigation
Declaration
public PropertyMetadataBuilder<T, TProperty> Property<TProperty>(
Expression<Func<T, TProperty>> propertyExpression
)
Parameters
Name | Type | Description |
---|---|---|
propertyExpression | Expression<Func<T, TProperty>> | A lambda expression that returns a ViewModel property. |
Type Parameters
Name |
---|
TProperty |
Returns
Type | Description |
---|---|
PropertyMetadataBuilder<T, TProperty> | The property metadata builder instance. |
Remarks
The Property<TProperty> property is recognized by the GridControl, TreeListControl, DataLayoutControl and PropertyGridControl.
See the example below.
void IMetadataProvider<DataAnnotations_FluentAPI>.BuildMetadata(MetadataBuilder<DataAnnotations_FluentAPI> builder) {
builder.Property(x => x.StringProperty)
.Required()
}
See Also