I’ve (very) recently started studying about Prism (for a WPF app) and I’ve been working on a small demo app for my team. My question is a rather general one but I can’t find a simple example to direct me:
Assuming I have the Shell (in the main module), and the Shell has a region which should be filled by a content from a different module (BTW, is this a good idea?).
How does this happen exactly? Who’s responsible for adding the view from the other module into the Shell’s designated region? When is the other module’s relevant view-model being initialized? Code samples / links to them would be appreciated.
Thanks!
Edit: Question split, please see the new question.
Yes, separating shell and views is a good idea.
The RegionManager is responsible for adding the view into the regions. Therefore you register the region to the RegionManager as well as you register the view to the RegionManager.
Inside the shell you will end up with something like:
Now you have to register the view to the region it will reside in:
The example code shows both types of registrations. The first one is for view first approaches, the latter on for view model first approaches.
[EDIT]
The region names are defined in a static class in the infrastructure module:
[/EDIT]