I'm having problems with my application after upgrading from 4.1 to 5.0.
Code that worked with PRISM 4.1 is as follows:
// Build query parameters
NavigationParameters query = new NavigationParameters(); // UriQuery previously
// Navigate to DashboardTabView with a title for the Tab item
new Uri("EDM_ContractWaterFlowExtensionTabView" + query.ToString(), UriKind.Relative),
// Parameters for view
NavigationParameters viewParams = new NavigationParameters();
// Current control instance ID
// Get scoped region manager and use it to navigate to sub view
var myRegionManager = result.ExtractRegionManager();
new Uri("EDM_ContractWaterFlowSiteListView" + viewParams.ToString(), UriKind.Relative)
But after upgrading to 5.0 I get following exception when requesting navigation to view in a region that already has one view (tab). This TabRegion is TabControl (which at this point already has one view with TabContentRegion) and I try to create another Tab
with scoped region manager when navigating to the view EDM_ContractWaterFlowExtensionTabView.
An exception of type 'Microsoft.Practices.Prism.Regions.UpdateRegionsException' occurred in Microsoft.Practices.Prism.Composition.dll but was not handled in user code
Additional information: An exception occurred while trying to create region objects.
InnerException: Region with the given name is already registered: TabContentRegion
Changes that I have done are only changing UriQuery to NavigationParameters.
So adding first tab (view) works but when adding second one I get the exception.
ViewModel of the view that I try to navigate to is as follows:
public class EDM_ContractWaterFlowExtensionTabViewModel : DashboardTabViewModelBase
DashboardTabViewModelBase (NotificationObject changed to BindableBase
public abstract class DashboardTabViewModelBase : BindableBase, INavigationAware, IRegionManagerAware