Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Collapse]eXpressApp Framework
 [Expand]Fundamentals
 [Expand]Getting Started
 [Collapse]Concepts
  [Expand]Application Solution Components
  [Expand]Business Model Design
  [Expand]Application Model
  [Collapse]UI Construction
    UI Element Overview
    Windows and Frames
   [Expand]Templates
    Action Containers
   [Expand]Views
   [Expand]View Items
    List Editors
    Add and Override Images
    Text Notifications
    ASP.NET Web Application Appearance
    Application Personalization
    Using a Custom Control that is not Integrated by Default
  [Expand]Extend Functionality
  [Expand]Data Manipulation and Business Logic
  [Expand]Security System
  [Expand]Localization
  [Expand]System Module
  [Expand]Extra Modules
  [Expand]Debugging and Error Handling
  [Expand]Filtering
  [Expand]Application Life Cycle
 [Expand]Design-Time Features
 [Expand]Functional Testing
 [Expand]Deployment
 [Expand]Task-Based Help
 [Expand]Frequently Asked Questions
 [Expand]API Reference
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Action Containers

To display an Action in a UI, the eXpressApp Framework uses Action Containers. An Action Container is a control that either displays an Action in a UI, or contains several controls displaying a specified set of Actions. Action Containers are located on Templates. There are several types of Action Containers in the eXpressApp Framework. This topic defines all of them, and provides information on how to customize Action Containers and implement your own.

Expanded Action Container Types

An Action Container is a control that implements the IActionContainer interface. This interface provides access to the Action collection, and declares the IActionContainer.Register method to create controls that represent Actions. The eXpressApp Framework supplies a number of built-in Action Containers for automatic UI construction in Windows Forms and ASP.NET Web applications. Built-in Action Containers for Windows Forms and ASP.NET Web applications are located in the DevExpress.ExpressApp.Win and DevExpress.ExpressApp.Web assemblies, respectively. The following tables list all these Action Containers:

Windows Forms Action Containers

Action Container

Base Class

Description

ActionContainerBarItem XafBarLinkContainerItem A toolbar ItemLinks container. Displays Actions as toolbar items.
ActionContainerMenuBarItem ActionContainerBarItem Differs from the ActionContainerBarItem Action Container in the control used for the SingleChoiceAction type Actions when their SingleChoiceAction.ItemType property is set to the ItemIsMode value, and the ChoiceActionBase.IsHierarchical method returns false. In this case, the ActionContainerMenuBarItem uses BarSubItem bar items to display these Actions as sub-menu entries.
ButtonsContainer LayoutControl A layout control. Creates a layout item containing a button for each Action.
NavigationActionContainer Panel A navigation control. Displays the ShowNavigationItem Action's items as navigation control links. Uses the NavBarNavigationControl and TreeListNavigationControl controls.

ASP.NET Web Action Containers

Action Container

Base Class

Description

ActionContainerHolder Panel

A set of links, a set of buttons or a toolbar. The visual representation is defined by the ContainerStyle property which can be set to ActionContainerStyle.Links, ActionContainerStyle.Buttons or ActionContainerStyle.ToolBar. The ActionContainerHolder class has an important property that affects its behavior:

Orientation - when this property is set to ActionContainerOrientation.Horizontal, Actions are arranged horizontally from left to right. When this property is set to ActionContainerOrientation.Vertical, Actions are arranged vertically, top to bottom.

NavigationActionContainer ASPxPanel A navigation control. Displays the ShowNavigationItem Action from the ViewsNavigation category. The Action's items are displayed as navigation control links. Used in the built-in DefaultVertical Template. Uses the NavBarNavigationControl and TreeListNavigationControl controls.
NavigationHistoryActionContainer WebControl Used to display Actions from the ViewsHistoryNavigation category. Displays the Action's items as links, delimited by separator characters. Not available in the new web UI.
NavigationTabsActionContainer Panel A tabbed navigation control. Used to display the ShowNavigationItem Action from the ViewsNavigation category. The Action's first-level navigation items are displayed as tab pages, and their child navigation items - as links.
QuickAccessNavigationActionContainer Panel Used to display the ShowNavigationItem Action from the ViewsNavigation category. Displays the Action's items as links, delimited by separator characters.

Expanded Action Container Creation

When a Template is created, all its Action Containers are created as well. Then, the built-in FillActionContainers Controller uses the Application Model to determine the Actions to be displayed within Action Containers. In particular, the ActionDesign | ActionToContainerMapping node provides this information. Then, this Controller calls the Action Container's Register method for each Action to create the corresponding control. Action Containers create specific controls for each Action type. For example, the ActionContainerBarItem Action Container creates the BarButtonItem object for a SimpleAction Action, and the BarEditItem control, for a SingleChoiceAction Action, etc.

Expanded Action Container Customization

You can customize the Actions set of a particular Action Container at design time and runtime. In code, you can change the Action Container's appearance settings, and change Action settings.

  • Customization in the Application Model

    The Application Model contains the ActionDesign | ActionToContainerMapping node. This node contains information on what Actions a particular Action Container must display. You can customize the automatically generated information in the Model Editor at design time or runtime. In this node, you can move an Action to another Action Container, delete an Action from a particular Action Container, etc. You can also add a new Action Container and add Actions to it, but this Action Container will only be displayed in a UI if it is contained in a Template. For information on this Application Model node, refer to the IModelActions interface description.

  • In code

    To customize an Action Container, handle the Frame.ProcessActionContainer event. You can customize an Action Container using its properties. You can also access Actions of a particular Action Container using the IActionContainer.Actions property, and customize the required Action. For instance, you can deactivate an Action, calling its ActionBase.Active property. In addition, you can access an Action's control and customize it.

    You can customize a toolbar's bar item by handling the CustomizeActionControl event of the corresponding bar items factory. To learn how to do this, refer to the How to: Customize Action Controls topic.

    You can handle the ActionControlsSiteController.CustomizeContainerActions event to customize the action-to-container mapping in code.

Expanded Implement Your Own Action Container

If you need to change controls used to display Actions, you can implement your own Action Containers. To do this, inherit from the required control and implement the IActionContainer interface. Another approach is to derive your custom container from one of the existing Action Containers listed above. Note that you may also need to specify the controls to be used for each Action type.

After declaring your own Action Container, create a new Template or customize an existing one, as described in the following topics.

Add your Action Container to the Template, and then add your Action Container's instance to the list returned by the Template's IFrameTemplate.GetContainers method. If you have XAF sources installed, you can see how built-in Action Containers are implemented in the following locations:

  • %PROGRAMFILES(x86)%\DevExpress 17.1\Components\Sources\DevExpress.ExpressApp\DevExpress.ExpressApp.Web\Templates\ActionContainers\
  • %PROGRAMFILES(x86)%\DevExpress 17.1\Components\Sources\DevExpress.ExpressApp\DevExpress.ExpressApp.Win\Templates\ActionContainers\

Expanded See Also

How would you rate this topic?​​​​​​​