Let's suppose we want to decouple our application that uses RadRibbonBar as a main menu. Doing this using Composite Application Guidelines (Prism) is common scenario, so let's see how to achieve it.
We'll make our RadRibbonBar to serve as RegionManager (This is possible because RadRibbonBar inherits from ItemsControl) and the RadRibbonTabs as actual views that will be plugged-in.
So first we start with declaring RadRibbonBar as RegionManager :
Having Region we can focus on creating the actual views. Let's add new Silverlight class library project and name it SalesRibbonTab. Now we need the view itself, so add new class let's say Ribbon that inherits from RadRibbonTab.
And associate xaml file with it.
Ok. Now we need a class that will serve as the glue between the RegionManager and the actual View. It has to inherit from IModule and lets name it
Having the SalesRibbonTabModule class, now we need to add instance of it to the ModuleCatalog in the Bootstrapper class.
Now we are all set and can use all the benefits of Composing the UI.
Download the demo project including the Prism dlls from here.
[Update] The project is updated and improved in new post. Find more.
Subscribe to be the first to get our expert-written articles and tutorials for developers!