I have 2 regions setup in my shell ToolBarRegion(ItemsControl) and DetailsRegion(ContentControl). I load 3 modules in the bootstrapper
Companies: This module will display a list of companies
When this module get initialized it gets added to the DetailsRegion.
Public Companies(IRegionManager _regionManager)
regionManager = _regionManager;
public void Initialize()
CompanyDetails cd = new CompanyDetails();
IRegion region = regionManager.Regions["DetailsRegion"];
Users: This module shows a list of users and it's initialized like the code above
MainToolBar: When initialized gets added to the ToolBarRegion and then activated - like above code but also calls region.Activate(viewname).
This module will display buttons which will have their tag property bound to the name of the view to be displayed. These views are in the other modules(Companies,Users) that get loaded in the bootstrapper.
I have a delegate command in my MainToolBarViewModel called ShowView. This is set as the command for the button.
It does the following
public void ShowView(object param)
It breaks on the above line with the following error "The region does not contain the specified view Parameter name:view"
The param object is showing the correct name for the view i want to show, also if i drill into the Regions and expand the Results view it shows 2 entries 1 for the ToolBarRegion and 1 for the DetailsRegion.
If i expand the DetailsRegion and then expand the Views then expand Results view i can see the 2 views i have loaded into this region.
Can anybody shed some light on what i'm doing wrong here.
I've also had a look at the following post
http://compositewpf.codeplex.com/Thread/View.aspx?ThreadId=67573 but still same error whichever way i try.