eXpressApp Framework (XAF) includes standard images embedded into the DevExpress.Images assembly. In this lesson, you will learn how to associate a business class with a standard image. This image will represent the class in the navigation control, including detail and list form headers. For this purpose, the Department and Position classes will be used, since their ancestor (BaseObject class) is not associated with an image.
To see the available images, browse the following folder: %PROGRAMFILES(x86)%\DevExpress 18.2\Components\Sources\DevExpress.Images\Images.
Before proceeding, take a moment to review the Place an Action in a Different Location lesson.
When the business class has no image assigned, the default "BO_Unknown" image is used in the user interface.
Follow the steps below to assign more suitable images to the Department and Position classes.
Invoke the Model Editor. Navigate to the BOModel | MySolution.Module.Business_Classes | Department node and change the ImageName property value to "BO_Department". This is the name of the image located in the %PROGRAMFILES(x86)%\DevExpress 18.2\Components\Sources\DevExpress.Images\Images folder. This folder represents a Standard Image Library.
Navigate to the BOModel | MySolution.Module.Business_Classes | Position node and change the ImageName property value to "BO_Position".
Run the application. You will see that Department and Position now have corresponding images displayed within the navigation bar and tab panel. If you run the ASP.NET application, you will see similar images within the page header when the Department (or Position) List View or Detail View is active.
You can see the changes made in this lesson in the Model Editor, invoked for the Model.DesignedDiffs.xafml file located in the Main Demo | MainDemo.Module project. The MainDemo application is installed in %PUBLIC%\Documents\DevExpress Demos 18.2\Components\eXpressApp Framework\MainDemo by default. The ASP.NET version is available online at http://demos.devexpress.com/XAF/MainDemo/.
Next Lesson: Assign a Custom Image