Skip to main content
A newer version of this page is available. .

MetadataLocator.Create() Method

Creates a metadata locator instance.

Namespace: DevExpress.Mvvm.DataAnnotations

Assembly: DevExpress.Mvvm.v20.2.dll

NuGet Packages: DevExpress.Mvvm, DevExpress.Uwp.Controls, DevExpress.WindowsDesktop.Mvvm

Declaration

public static MetadataLocator Create()

Returns

Type Description
MetadataLocator

The metadata locator instance.

Remarks

See the example below.

MetadataLocator.Default = MetadataLocator.Create()
    .AddMetadata<Metadata>();
public class Metadata {
    public static void BuildMetadata(MetadataBuilder<Employee> builder) {
        builder.Property(x => x.FullName).ReadOnly();
    }
    public static void BuildMetadata(MetadataBuilder<Team> builder) {
        builder.Property(x => x.Id).ReadOnly();
    }
}
See Also