Skip to main content
.NET 8.0+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.v24.2.dll

NuGet Package: DevExpress.ExpressApp

#Declaration

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface, 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