Use the OutlookBar in your CompositeWPF (Prism) Applications
Two years ago, together with Matias Woloski we wrote the Outlook Bar for the Composite Application Block (CAB). I can say that it was a popular workspace, with more than 19,000 downloads!. Now that we shipped CompositeWPF (Prism), some people at the CompositeWPF community started asking for the OutlookBar for CompositeWPF, so Julian Dominguez, Matias Woloski and me decided to spend some time and create the Composite WPF version.

Usage
First of all, you have to register the region adapter mapping in the Bootstrapper as shown in the code below:
protected override RegionAdapterMappings ConfigureRegionAdapterMappings() { IEventAggregator eventAggregator = Container.Resolve<IEventAggregator>(); RegionAdapterMappings mappings = base.ConfigureRegionAdapterMappings(); mappings.RegisterMapping(typeof(OutlookBarControl), new OutlookBarControlRegionAdapter(eventAggregator)); return mappings; }
Now you can add the OutlookBarControl to your Shell/View XAML (you have to declare the namespace on the top of the file):
<Controls:OutlookBarControl
cal:RegionManager.RegionName="{x:Static infrastructure:RegionNames.OutlookBarRegion}"/>
To add views, just obtain the region and call the Add method as you do with other regions:
IRegionManager regionManager = Container.Resolve<IRegionManager>(); MyView view = new MyView(); OutlookBarControl.SetOutlookBarMetadata(view, new OutlookBarMetadata { Title = "Mail", Payload = "MyPayload" }); regionManager.Regions[RegionNames.OutlookBarRegion].Add(view); regionManager.Regions[RegionNames.OutlookBarRegion].Activate(view);
As you may noticed, in the preceding code we are also setting the OutlookBarMetadata attached property to the view. This attached property is used by the control template and by the OutlookBarControlRegionAdapter.
- In the control template we are using the Title property in the OutlookBarControl header and in the buttons.
- In the region adapter we are using the payload to publish the OutlookBarEvent. This event is published every time you select a view.
The OutlookBarMetadata serves a similar purpose the OutlookBarSmartPartInfo served in the CAB version.
Disclaimer
This code is provided "AS IS" with no warranties, and confers no rights.
Acknowledgments
The control template is based on this article on CodeProject.
Download
You can get the OutlookBar by downloading the latest change set of the CompositeWPF Contrib source control.
Stay tuned, we are working on v1.1 of the OutlookBar.
Use the OutlookBar in your CompositeWPF (Prism) Applications…
Two years ago, together with Matias Woloski we wrote the Outlook Bar for the Composite Application Block…
[...] more about the implementation in Ezequiel’s post and download the code from the contrib [...]
[...] de OutLook, y la eh integrado con CompositeWPF, aunque la forma todavia no me convence del todo ( parece que han hecho un control de este tipo dentro del proyecto de CompositeWPF [...]
[...] OutlookBar control and region adapter. For more information about this control, see Use the OutlookBar in your CompositeWPF (Prism) Applications. [...]
Hi there…
I’m new to the WPF Composite and I’m having a very hard time adapting to it…
I was trying to use this control in my project but I’m lost… Is there any sample in which this control is used? If there is, where it is? Because I’ve searched all the samples i found in the code plex website…
Thanks for you work…:P And thanks in advance for your help.
Daniel Alves
[...] people has been asking for an OutlookBar sample. The good news is that Damian Schenkelman and me are working on it, so stay tuned, we will [...]