Skip to main content
.NET Framework 4.5.2+

Perform Common Tasks With XAF Actions

  • 4 minutes to read

This article describes the most common tasks with XAF Actions.

Add an Action to a Controller


In .NET Core applications, it is impossible to add an Action to a Controller in the Controller’s Designer because of the changes in Visual Studio’s designer architecture. You can add an Action in code as described below.

If you require an Action that applies to multiple business objects and takes user input, add this Action to a Controller.

You can also add an Action to a Controller in code.

using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Actions;
using DevExpress.Persistent.Base;
// ...
public class CustomViewController : ViewController {
    public CustomViewController() {
        SimpleAction customAction = new SimpleAction(this, "CustomAction", PredefinedCategory.View);
        // or
        customAction.Category = PredefinedCategory.View.ToString();
        // or 
        customAction.Category = "View";
        // or 
        customAction.Category = "MyCustomCategory";

After you add an Action to a Controller, you can use the Designer to customize the Action.


CodeRush allows you to add Actions and Controllers with a few keystrokes. To learn about the Code Templates for XAF, refer to the following help topic: XAF Templates.

Add an Action by Applying the Action Attribute to a Business Class Method

If you require an Action that applies to one business object and uses the business object’s parameters, apply the Action attribute to the business class’s method as shown below:

Use the Action attribute only for simple scenarios similar to those described in the articles. For greater flexibility, you can add an Action to a Controller.

Use Action Settings

The base class for all Action types is the ActionBase class. This class exposes events, properties, and methods that support the common Action behavior.




Access the ActionBase class’s members page for a complete list of available API.

Customize an Action in the Application Model

Information on Actions is available in the Application Model’s ActionDesign node.

Customize an Action in Code

You can access Actions and customize them in code.

Create Custom Action Types and Custom Controls

In XAF, you can create custom Action types and custom controls. See the examples below:

Troubleshoot Actions

See the articles below to learn how to diagnose and fix the most frequently encountered problems.