With reference to question: http://www.devexpress.com/issue=B147367, I would like to suggest this be added to XAF as standard.
Proposed Solution:
The following modification to the XAF application model should be done:
Add the following properties to the model: TargetRibbonPage and TargetRibbonGroup properties to Action items so that these can be specified in the model.
The ActiontoContainerMapping should also have a TargetRibbonPage property where a group for this mapping will be placed.
These properties SHOULD apply to all available actions and ActiontoContainerMappings.
When generating the Ribbonbar, it would then be simple enough to read each action and place it on the corresponding ribbon page. The benefits of this is that developers will now have full control over where items are placed on the ribbon bar, allowing them to fully customize thier ribbon without the need to write a single line of code.
This can also be extended to items placed on the Navigation bar. By specifying these two additional properties for the navigationitem attribute, developers can choose whether they want the items on the standard navigation bar or if they would like them placed on the ribbon bar (if the TargetRibbonxxx properties of the navigationitem attribute are null they go on the navigation bar else ribbon bar on page and group specified)
I strongly believe this will be an easy modification for XAF to implement and the benefit derived from it will make a huge difference for developers when it comes to customizing an already great framework.
How to map Actions to a certain RibbonPage and RibbonGroup using the Application Model or in code
Answers
For 15.1+ with the new WinForms templates:
See two possible solutions for accomplishing this task:
1. RibbonFromModelWithEventController.cs
It handles the ActionControlsSiteController.CustomizeContainerActions event to move marked Actions from the original Action Container (IModelAction.Category) into another container specified in the TargetRibbonGroup property via the IModelAction interface extension. Note that the universal BarLinkActionControlContainer class is used instead of the RibbonGroupActionControlContainer one, because starting with v15.1, our XtraBars library got the RibbonControl.AllowInplaceLinks feature.
2. RibbonFromModelWithoutEventController.cs
This approach is very similar to the first one, except for using the Model Editor instead of the ActionControlsSiteController.CustomizeContainerActions event as shown in the attached video (RibbonFromModelWithoutEventController_demo.swf).
For older versions with the old WinForms templates:
You can use a solution shown in the RibbonFromModelController.cs file attached to the no ribbontemplates node issue.
See Also: Allow Toolbars customization from Model and End User Interface and Customize Ribbon via Model
Thanks,
Dennis