Prism Region in Backstage

Aug 6, 2010 at 11:31 AM
I'm using CAL (also known as CompositeWPF or patterns & practices: Prims; and want to place a Region in the Fluent Ribbon Backstage.

<fluent:RibbonWindow x:Class="Shell" ....>
<fluent:Ribbon ...>
<fluent:Ribbon.BackstageTabItem ...>
<ContentControl cal:RegionManager:RegionName="MyRegionName" />

Unfortunately, this doesn't work. As far as I know the reason is the following: In CAL, the RegionManager is attached to the Shell/RibbonWindow, and the RegionName attached property searches for that attached region manager in the logical tree parents of the ContentControl. But in Fluent the Backstage items are not in the same logical tree as the RibbonWindow - they are in an adorner which starts a completly unconnected logical tree.

To solve this I think I would have to attach the region manager manually to a parent of the backstage items (this does not seem to be possible in fluent, as the backstage and backstageButton are private and the BackstageItems is not a DependencyProperty) or even to each BackstageTabItem (which kind of defeats the purpose of using CAL in the first place.)

Does anyone have a better idea?

Aug 16, 2010 at 10:30 AM
Could maybe a public Backstage getter property be added to the Ribbon?
Aug 16, 2010 at 12:46 PM

Yes, it will in v2

Apr 6, 2011 at 3:43 PM

I too want to achieve this but have no idea how to. Since v2 is out can you share with us how you would do this? I want to load the backstageitems into the region from another Prisim module.

Apr 12, 2011 at 7:30 AM

Thankfullly, in v2 I think no tricks are needed anymore to make the RegionManager work in the backstage. I'm simply doing this now:


            <r:BackstageTabItem Header="Title of tab for module 1">
               <ContentControl prism:RegionManager.RegionName="Module1" />
            <r:BackstageTabItem Header="Title of tab for module 2">
               <ContentControl prism:RegionManager.RegionName="Module1" />


(I currently have a known fixed number of modules with one backstage tab each, so I define these in the Shell. If you need a dynamic number of items you might have to write and register a Prism RegionAdapter...)

Hope this helps.