Skip to main content
.NET Framework 4.6.2+

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ImageInfo Struct

Supplies metadata information on an image used in an XAF application.

Namespace: DevExpress.ExpressApp.Utils

Assembly: DevExpress.ExpressApp.v24.2.dll

NuGet Package: DevExpress.ExpressApp

#Declaration

public struct ImageInfo :
    IEquatable<ImageInfo>

#Remarks

An ImageInfo instance is an image used in an XAF application. Its properties provide access to the image and associated metadata, such as image dimensions and name.

XAF uses the ImageLoader class to manage images. To get an ImageInfo instance, use the ImageLoader.Get...ImageInfo methods. The following code snippet demonstrates how to use the ImageInfo.Image property to retrieve the specified image:

C#
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Actions;
using DevExpress.ExpressApp.Utils;
using DevExpress.Persistent.Base;

namespace dxTestSolution.Module.Controllers {
    public class CustomBlazorController : ViewController {
        public CustomBlazorController() {
            var _actionName = "MyAction1";
            myAction = new SimpleAction(this, _actionName, PredefinedCategory.Edit);
            myAction.Caption = _actionName;
            myAction.ToolTip = myAction.Caption;
        }
        SimpleAction myAction;
        protected override void OnFrameAssigned() {
            base.OnFrameAssigned();
            string imageName = $"action_export_tortf";
            var imageInfo = ImageLoader.Instance.GetImageInfo(imageName);
            if (!imageInfo.IsEmpty) {
                myAction.ImageName = imageName;
                myAction.Execute += (s, e) => { /*Add your custome code here*/ };
            }
        }
    }
}

For general guidelines on how to use images in an XAF application, refer to the following topic: Add and Replace Icons.

See Also