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.
public partial class Ribbon : 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
public class SalesRibbonTabModule : IModule
private readonly IRegionManager regionManager;
public SalesRibbonTabModule(IRegionManager regionManager)
this.regionManager = regionManager;
public void Initialize()
Having the SalesRibbonTabModule class, now we need to add instance of it to the ModuleCatalog in the Bootstrapper class.
public class Bootstrapper : UnityBootstrapper
protected override DependencyObject CreateShell()
Shell shell = Container.Resolve<
Application.Current.RootVisual = shell;
protected override IModuleCatalog GetModuleCatalog()
ModuleCatalog catalog = new ModuleCatalog()
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.
Miro Miroslavov is XAML enthusiast. You can follow him on Twitter at @mmiroslavov.
Copyright © 2016, Progress Software Corporation and/or its subsidiaries or affiliates. All Rights Reserved.
Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks or appropriate markings.