Skip to content

DevExpress-Examples/xaf-how-to-implement-a-custom-attribute-to-customize-the-application-model

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XAF - How to implement a custom attribute to customize the Application Model

This example demonstrates how to create a custom attribute and remove a property from the Application Model's DetailView.Items and ListView.Columns nodes. In this case, the properties marked with this attribute are removed from views.

Implementation Details

To implement this functionality, the IModelMember interface is extended with the IRemovedFromViewInfo interface that contains the IsRemovedFromViewInfo property. The value of this property is calculated based on the value of the custom attribute we created (RemoveFromViewInfoAttribute) and applied to the persistent class via the domain logic (RemovedFromViewInfoLogic). The IRemovedFromViewInfo.IsRemovedFromViewInfo property is used by the model node generator updater (ViewsNodesGeneratorUpdater) to remove certain view items and columns from detail and list views.

This example demonstrates three techniques: how to extend the application model with additional properties, define default model values via domain logic, and modify the default model via the model node generator updater.

Files to Review

Documentation

Releases

No releases published

Packages

No packages published