Blogs

Gary's Blog

XAF Cookbook #5 – Customise Your Default BO Images

     

Problem

You wish to substitute the default image, for a business object, with a custom one of your own.

Solution

Create two images one 16X16, the other 32X32, name the smaller one with the name of your business object and the larger one with the name of your business object with “_Large” appended to it. In the module where you created your business object, create a folder named “Images”. Add both of your images to this folder and include them in the project. Set both the image’s “Build Action” properties to “Embedded Resource”. Next, open the model editor and navigate to Application –> BOModel –> <your BO name> and set the “ImageName” property to the name of your BO. Save the model. Run your application again and the default images in both the navbar and the icon for the the details view window will have been replaced.

Discussion

Although you can use any type of graphics file, the png format is best because of its support for the alpha channel. Also, if you use image sizes other than 16X16 and 32X32 the image will be resized for the details view window icon, but not for the navbar image. Further details can be found here.

Technorati tags:
Digg This
Published Sep 08 2008, 04:41 PM by Gary Short (DevExpress)
Filed under:
Technorati tags: XAF Cookbook
Bookmark and Share

Comments

 

Michael Proctor [DX-Squad] said:

Just a word of warning, firstly something not mentioed here is that for VB you must add "Images." in front of your image.

ALSO a BIG NOTE is that both "Images." and "_Large" are case-sensitive.

Cheers,

Michael Proctor

September 8, 2008 8:00 PM
 

Gary's Blog said:

5.1? 5.1?! I hear you ask, what happened to #6?! Don’t worry, it’ll be along tomorrow; but for the moment

August 19, 2009 1:50 PM
More from DevExpress
Live Chat
Have a pre-sales question?
Need assistance with your evaluation?
We are here to help.
Chat is one of the many ways you can contact members of the DevExpress Team. We are available Monday-Friday between 8:30am and 5:00pm Pacific Time.
If you need additional product information, require pre-sales assistance, or want help with your order, write to us at info@devexpress.com or call us at
+1 (818) 844-3383.