
I've got a docksite assigned to a Prism region that is dynamically loaded with documents by adding viewmodels to the region. Now, this all works just fine, and the region manager ensures that only the active viewmodel's commands are responded to (this was all discussed here).
However, the application I am working on must have two docksites and I'm not sure how best to proceed. I can think of two paths forward.
1. Two docksites, each with its own region.
However, the application I am working on must have two docksites and I'm not sure how best to proceed. I can think of two paths forward.
1. Two docksites, each with its own region.
- The regions will need to coordinate with each other as to which should inactivate all its viewmodels and which should have one active viewmodel.
- One issue with this approach: clicking into tabbed documents across docksites/regions doesn't activate the document you click on. If you have docs tiled in one docksite/region then clicking anywhere on the tab or document area activates its viewmodel; however, this doesn't seem to be the case when clicking across docksites/regions. I'm not sure if this is an "across-regions" or an "across-docksites" issue.
- Only one docksite can associate with the region. So, all viewmodels must be added to the docksite assigned to the main region and then moved from this main docksite to the other docksite. I'm not sure how I would perform the "move" operation. Is it the viewmodel that I move? For reference, the docksite is populated using view injection: regionManager.Regions["MainRegion"].Add(viewModel). The "move" operation would need to maintain the viewmodel's connection to the region so that the commands/IActiveAware setup still works