Skip to main content
.NET 6.0+

ShowNavigationItemController.ShowNavigationItemAction Property

Provides access to the ShowNavigationItemController‘s ShowNavigationItem Action.

Namespace: DevExpress.ExpressApp.SystemModule

Assembly: DevExpress.ExpressApp.v24.1.dll

NuGet Package: DevExpress.ExpressApp

Declaration

public SingleChoiceAction ShowNavigationItemAction { get; }

Property Value

Type Description
SingleChoiceAction

A SingleChoiceAction object representing the ShowNavigationItem Action.

Remarks

The ShowNavigationItem Action is intended to navigate between predefined Views. Its ActionBase.Category property is set to “ViewsNavigation”. In Windows Forms applications, Actions from this category are mapped to the NavigationActionContainer and the ActionContainerMenuBarItem. The NavigationActionContainer displays its Actions via a navigation bar or a tree list. The ActionContainerMenuBarItem displays Actions as menu subitems within the Views menu item. So, you can find the ShowNavigationItem Action displayed in two places in the Windows Forms main form:

ShowNavigationITemAction_Win

NavigationActionInMenu

In an ASP.NET Web Forms applications, Actions from the “ViewsNavigation” category are mapped to the NavigationTabsActionContainer and NavigationLinksActionContainer in the Default Template. In the DefaultVertical Template, Actions are mapped to the NavigationActionContainer and NavigationLinksActionContainer. The NavigationTabsActionContainer displays its Actions via the ASPxPageControl. The NavigationActionContainer displays them via the ASPxNavBar or the ASPxTreeList control. The NavigationLinksActionContainer displays Actions as links delimited by a separator:

ShowNavigationITemAction_Web

NavigationActionInLinks

NavigationActionInNavBar

As you can see in the images, there are child navigation items and first-level navigation items, where the items are contained. Navigation items represent the elements of the ShowNavigationItem Action’s Items collection (see ChoiceActionBase.Items). This collection has a tree-like structure. First-level navigation items represent the elements at the first level of the tree, and navigation items represent elements at the second level of the tree. The Items collection is generated using information from the Application Model‘s IModelRootNavigationItems node. This node has the NavigationItem child nodes.

ShowNavigationITemAction_NavigationItemsNode

The NavigationItem nodes have the IModelNavigationItem.View property. This property should be set to the View that will be displayed when clicking the corresponding navigation item in the navigation control. To add a node to the NavigationItems node, apply the DefaultClassOptionsAttribute or NavigationItemAttribute to a business class. In addition, you can add a NavigationItem node manually, using the Model Editor.

Note

You can generate a new NavigationItem node in code, using the Generator Updater for the NavigationItemNodeGenerator node generator.

To modify the ShowNavigationItem Action’s Items collection, use one of the following techniques:

The ShowNavigationItem Action is automatically executed after the main Window has been loaded. The View shown corresponds to the navigation item returned by the ShowNavigationItemController.GetStartupNavigationItem method. The Action execution is performed by the WinShowStartupNavigationItemController in Windows Forms applications, and the WebShowStartupNavigationItemController in ASP.NET Web Forms applications. If you do not need to show a View when starting up, or need to change the behavior of these Controllers, deactivate them via the Controller.Active property.

You can organize a keyboard approach for navigating between the navigation control’s items in Windows Forms applications. For this purpose, use the NavigationItem node’s Shortcut property. Moreover, you can hide the navigation control and use keyboard shortcuts only. In addition, navigation items can be represented by images. For this purpose, set appropriate images for the IModelBaseChoiceActionItem.ImageName property of the IModelNavigationItem node.

You can replace the navigation control that presents the ShowNavigationItem Action with another one. For instance, you can choose using a TreeList control. To learn how to do this, refer to the Navigation System topic. If you want to use another control, implement a custom Action Container.

Information on the ShowNavigationItem Action is available in the Application Model‘s ActionDesign node. To access it, use the Model Editor.

See Also