Back to Devexpress

ActionBase.ImageName Property

expressappframework-devexpress-dot-expressapp-dot-actions-dot-actionbase-43747dbb.md

latest6.9 KB
Original Source

ActionBase.ImageName Property

Specifies a name of the image displayed for an Action.

Namespace : DevExpress.ExpressApp.Actions

Assembly : DevExpress.ExpressApp.v25.2.dll

NuGet Package : DevExpress.ExpressApp

Declaration

csharp
[DefaultValue(null)]
public string ImageName { get; set; }
vb
<DefaultValue(Nothing)>
Public Property ImageName As String

Property Value

TypeDefaultDescription
Stringnull

A string value that represents the name of the current Action’s image.

|

Remarks

Use the ImageName property to specify the name of the image that will be displayed for the current Action. By default, this property is not set. You can set a value in the Controller’s constructor or Designer. This value will be saved to the Application Model‘s IModelAction node. You can change this value in the Model Editor. In a UI, the value which is specified in the Application Model’s .xafml file loaded last will be displayed. For information on the order of Application Model differences loading, refer to the Application Model Basics topic.

When setting a value to this property, the ActionBase.Changed event is raised.

To learn the concept by which XAF displays images for Actions and other UI elements, refer to the Add and Replace Icons topic.

The following code snippets (auto-collected from DevExpress Examples) contain references to the ImageName property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

XAF_How-to-get-role-code-from-the-UI/CS/XPO/GenerateRole/GenerateRole.Module/Controllers/RoleGeneratorController.cs#L28

csharp
roleGeneratorAction.Id = "RoleGeneratorAction";
roleGeneratorAction.ImageName = "Action_Export";
roleGeneratorAction.ToolTip = null;

xaf-print-a-report-without-displaying-a-preview/CS/EFCore/InstantReportEF/InstantReportEF.Module/Controllers/InstantPrintReportController.cs#L10

csharp
SimpleAction printAction = new SimpleAction(this, "PrintContacts", PredefinedCategory.Reports);
printAction.ImageName = "Action_Printing_Print";
printAction.Execute += delegate (object sender, SimpleActionExecuteEventArgs e) {

XAF_logon-form-manage-users-register-a-new-user-restore-a-password/CS/EFCore/Security.Extensions/ManageUsersOnLogonController.cs#L54

csharp
action.Caption = caption;
action.ImageName = imageName;
action.PaintStyle = ActionItemPaintStyle.Image;

xaf-how-to-import-data-in-xaf/CS/WinWebSolution.Module/ImportDataListViewController.cs#L30

csharp
importDataAction.Caption = "Import Data";
importDataAction.ImageName = "Attention";
item1.Caption = "In root ListView";

XAF-search-objects-using-complex-criterion/CS/Dennis.Search.Win/SearchObjectViewController.cs#L19

csharp
scaSearchObjectActionCore.Caption = Properties.Resources.SearchObjectActionText;
scaSearchObjectActionCore.ImageName = "Action_Search";
scaSearchObjectActionCore.ItemType = SingleChoiceActionItemType.ItemIsOperation;

xaf-how-to-import-data-in-xaf/VB/WinWebSolution.Module/ImportDataListViewController.vb#L33

vb
importDataAction_Renamed.Caption = "Import Data"
importDataAction_Renamed.ImageName = "Attention"
item1.Caption = "In root ListView"

XAF-search-objects-using-complex-criterion/VB/Dennis.Search.Win/SearchObjectViewController.vb#L25

vb
scaSearchObjectActionCore.Caption = Properties.Resources.SearchObjectActionText
scaSearchObjectActionCore.ImageName = "Action_Search"
scaSearchObjectActionCore.ItemType = SingleChoiceActionItemType.ItemIsOperation

See Also

Assign a Standard Image

How to: Assign Custom Images to Business Classes

Add and Replace Icons

ActionBase Class

ActionBase Members

DevExpress.ExpressApp.Actions Namespace