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.1.dll
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 ModelDefaultAttribute.PropertyName parameter specifies the property name, and the ModelDefaultAttribute.PropertyValue specifies the string representation of the default value.
using DevExpress.ExpressApp.Model;
// ...
[ModelDefault("Caption", "Task")]
public class DemoTask : Task {
// ...
}
The code above specifies that the Caption property of the BOModel | DemoTask node is set to “Task”, by default. If you customize this value in the Model Editor and later reset this customization, the value will be “Task” again.
See Also