Take the 2-minute tour ×

I've got a tab control with a region attached to it and I've also got a content control inside my tab controls content with another region.

The problem I'm having is - if I call RegisterViewWithRegion it adds the view to the region no problem (first time that is, get issues if you swap tabs). But this isn't very flexible and I'm looking for a better way to do that.

When I look inside IRegionManager.Regions as well - I can only see the two top level regions. I cant see my sub region TabContentRegion. Is there a way to register this so I can just work in the usual way with adding views and activating them?

   <TabControl TabStripPlacement="Left"
            SelectedItem="{Binding SelectedTab}">

                cal:RegionManager.RegionName="TabContentRegion" />


This code adds the views to the TabRegion

 public void Load()
     IConfigurationDetailsPresentationModel convDetailsView1 =

     IRegionManager manager = this.Container.Resolve<IRegionManager>();
     manager.RegisterViewWithRegion("TabRegion", () => convDetailsView1);

     IConversationDetailsPresentationModel conversationDetails = 
     manager.RegisterViewWithRegion("TabRegion", () => conversationDetails);

Then this is the code I've been using to actually display the view in the TabContentRegion

 public IPresentationModel SelectedTab
     get { return _selectedTab; }
         _selectedTab = value;

         IRegionManager service = this.Container.Resolve<IRegionManager>();

         if (service != null)
                 () => _selectedTab.View);

As you can see - it's a bit janky and doesn't quite work. Any ideas what I'm doing wrong?

Thanks for any help!

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

After alot of playing and googling I finally came across and answer!

because the region was inside a datatemplate, that ment that prisms standard behaviours wouldn't pick it up and register it with the region manager.

using the code provided here it helped me to fix this and carry on as normal! :)

cheers. ste.

share|improve this answer
add comment

Your Answer


