Skip to main content
.NET 6.0+

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

NuGet Package: DevExpress.ExpressApp

Declaration

[AttributeUsage(AttributeTargets.Class | AttributeTargets.Field | AttributeTargets.Interface, Inherited = false)]
public class ImageNameAttribute :
    Attribute

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.v23.2 assembly. To see the available images, browse the following %PROGRAMFILES%\DevExpress 23.2\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.

Inheritance

Object
Attribute
ImageNameAttribute
See Also