Provides access to the ShowNavigationItemController's ShowNavigationItem Action.
A SingleChoiceAction object representing the ShowNavigationItem Action.
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:
In an ASP.NET 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:
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.
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.
To modify the ShowNavigationItem Action's Items collection, use one of the following techniques:
- To generate this collection in a custom manner, handle the ShowNavigationItemController.CustomInitializeItems event.
- To modify this collection after it has been populated, handle the ShowNavigationItemController.ItemsInitialized event.
- To modify the View to be shown when an end-user clicks a particular navigation item, override the ShowNavigationItem method in the ShowNavigationItemController descendant, or handle the ShowNavigationItemController.CustomShowNavigationItem event.
- To disable or deactivate a particular item, use its ChoiceActionItem.Enabled and ChoiceActionItem.Active properties. To ascertain why an item is currently disabled or deactivated, use the DiagnosticInfo Action.
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 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.