Perform Common Tasks With XAF Actions

This article describes the most common tasks with XAF Actions.

Use Action Settings

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

Events

Properties

Tip

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

Add an Action to a Controller

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.

public class ViewController1 : ViewController {
    public ViewController1() {
        SimpleAction action1 = new SimpleAction(this, "Action1", DevExpress.Persistent.Base.PredefinedCategory.View);
    }
}

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

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.

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

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