Based on my understanding, you should be able to create a new Shell
in your application at any time by following the same steps that the bootstrapper does to create the main
- Create a Shell instance using the container.
- Set the corresponding RegionManager using the SetRegionManager method.
- Invoke the UpdateRegions method to register the regions in the
Brian has made a good remark in pointing that your view model should not create a
(or any other view) directly. Therefore, you could define a simple service that could be consumed by the view models and that would execute the aforementioned steps to create the
. It could also contain any logic to manage those windows, if needed. Besides the
, the rest of the services provided by Prism
, such as the
or the ModuleManager
, are independent of the
UI / Regions
of the application, so you should be able to use them in all the windows without problems.
Regarding the regions of the secondary Shells
, if your application will have several windows or will reuse views in different
, then I believe it could be appropriate to use an scoped
for each Shell
to avoid conflicts between region names (you can obtain a new
using the CreateRegionManager
method.) Take into account that the container only has the
of the main Shell
registered; therefore, you will need to manage the access to the scoped
of the secondary windows.
Also, in order to access the appropriate RegionManager
for a view depending on the
it's being shown on, you might find the RegionManagerAwareBehavior
described in the following blog post useful:
I hope this helps,