RegionManager not found

Jan 28, 2010 at 1:47 PM

Given this XAML:

<UserControl x:Class="LLNet.Modules.Pages.Views.MainFrame"
        <TabControl cal:RegionManager.RegionName="OuterRegion" ></TabControl>
                <TabControl cal:RegionManager.RegionName="InnerRegion" ></TabControl>


The "OuterRegion" gets registered but the "InnerRegion" does not.  This appears to be because when the RegionManagerRegistrationBehavior.TryRegisterRegion() is called in the second case the RegionManager is null. 

Can anyone tell me why (or, more to the point) how to get this to work.....


Jan 28, 2010 at 7:07 PM

I had a similar situation trying to declare submenu items in a RibbonDropDownButton control as regions.

For me this thread helped:

I've modified the RegionManagerRegistrationBehavior::FindRegionManager method in Microsoft.Practices.Composite.Presentation according to the above sited post:

... (line 161)

            parent = LogicalTreeHelper.GetParent(dependencyObject);
            if (parent == null)
                parent = System.Windows.Media.VisualTreeHelper.GetParent(dependencyObject);
            if (parent != null)
                return this.FindRegionManager(parent);

Hope it works for you.






Jan 29, 2010 at 9:02 AM


Thank you! Worked perfectly (although I not keen on having to modify the library :-{ )