.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+
.NET Core 3.0+
A newer version of this page is available. Switch to the current version.

ModelDefaultAttribute Class

Specifies default settings that are considered when generating the Application Model node related to the target.

Namespace: DevExpress.ExpressApp.Model

Assembly: DevExpress.ExpressApp.v19.2.dll

Declaration

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface, Inherited = true, AllowMultiple = true)]
public sealed class ModelDefaultAttribute :
    Attribute
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Property, Inherited = true, AllowMultiple = true)]
public sealed class ModelDefaultAttribute :
    Attribute

Remarks

  • When applied to a business class, specifies the default value of the Application Model's BOModel | <Class> node property.
  • When applied to a business class' member, specifies the default value of the Application Model's BOModel | <Class> | OwnMembers | <Member> node property.

The PropertyName parameter specifies the property name, and the PropertyValue specifies the string representation of the default value. Refer to the following topics to see available properties:

The code below sets the BOModel | DemoTask node's Caption property to "Task" and ImageName - to "Tasks". If you customize this value in the Model Editor and later reset this customization, the values will be "Task" and "Tasks" again.

using DevExpress.ExpressApp.Model;
// ...
[ModelDefault("Caption", "Task"), ModelDefault("ImageName", "Tasks")]
public class DemoTask : Task {
    // ...
}

Inheritance

Object
Attribute
ModelDefaultAttribute
See Also