RadControls version
|
2010.2.924.1040
(Trial DLL included) |
.NET version |
.NET 4 / Silverlight 4 |
Visual Studio version |
VS 2010 (Any version) |
programming language |
C# / Xaml |
browser support |
all browsers supported by RadControls
|
PROJECT DESCRIPTION
A sample project showing how to use the RadRibbonBar as a PRISM region and the RadRibbonTab as nested region
CONTEXT
The goal of this project was describe in this
forum thread and was to be able to inject the menu of each module inside a RadRibbonBar using the power of PRISM adapter so all modules never know that the shell use a RadRibbonBar. This allow you to change the shell structure at anytime without to change any module.
To do that we will create a custom (standard clr object) structure to hold all information we need to build the menu:
- ModuleDefinition
It contains the name of the module and a list of group.
This class will be converted to a RadRibbonBar.
- GroupDefinition
It contains the name of the group and a list of actions.
This class will be converted to a RadRibbonTab
- ActionDefinition
it contains the name, icon and command of the actions and also a list of sub actions
This class will be converted to a RadRibbonButton or a RadRibbonSplitButton if at least one sub action is defined
The solution contains 4 project:
*
RadRibbonBarPrism used as PRISM Shell and contains the PRISM adapters.
*
RadRibbonBarPrism.Common contains the class ModuleDefinition, GroupDefinition, ActionDefinition
*
RadRibbonBarPrism.ModuleA define a Module with one group and one action
*
RadRibbonBarPrism.ModuleB define a module with one group and one action that contains 2 sub action and also a group with one action in the nested region of the module A.
NOTE:
The code provided in this sample project is not ready to be used in production and you should be reviewed to add some error validation.