I wanted to compose my manuscripts entry view within the job details view to give it some context. So, I added a region to my job details view and refactored my OpenView call so that it took a region name. This worked fine for the the first job, but broke the second time because the second job details view instance tried to register the same region name with the global region manager as the first one.
The solution to this is to use scoped region managers. When adding a view to a region using injected (rather than discovered) views, you can request that it creates a new RegionManager that you can pass to the ViewModel to use when creating the nested view. Here are some articles about this approach:
http://msdn.microsoft.com/en-us/library/ff921098%28v=pandp.40%29.aspx
http://stackoverflow.com/questions/6582612/prism-4-locally-scoped-regionmanager
No comments:
Post a Comment