ImageNameAttribute Class
Specifies the name of the image that is displayed for the target class’ objects or target enumeration value.
Namespace: DevExpress.Persistent.Base
Assembly: DevExpress.ExpressApp.v24.1.dll
NuGet Package: DevExpress.ExpressApp
Declaration
Remarks
In XAF applications, you can associate business objects with images. For instance, these images are displayed in detail form headers. To assign an image to a particular business class, apply the ImageName attribute to this class. Pass the name of the required image as the attribute’s imageName parameter. This parameter’s value will be set for the IModelClass.ImageName property of the Application Model‘s BOModel | <Class> node. Note, you can set or change this property’s value directly in the Application Model via the Model Editor.
When this attribute is applied to a class, the specified image is displayed in detail forms, navigation control’s items and New Action. When the ImageName attribute is applied to an enumeration value, the specified image is displayed by the Property Editors bound to properties of the enumeration type.
The XAF ships with a number of standard images embedded into the DevExpress.Images.v24.1 assembly. To see the available images, browse the following %PROGRAMFILES%\DevExpress 24.1\Components\Sources\DevExpress.Images\Images folder. To assign one of these standard images to a class, pass the name of the image as the ImageName attribute’s parameter or use the Model Editor. For details, refer to the following article: Assign a Standard Image.
To assign a custom image to a business class, create the Images folder in one of your solution’s projects and save the required image to this folder. In the ImageName attribute, pass the image name only (without extension). The required image will be found in the Images folder. For details, refer to the Assign a Custom Image topic.
Note
The image which is set for a business class via the ImageName attribute in code is not inherited.
For details on image managing in XAF, refer to the Add and Replace Icons topic.