Hi,
Based on your description it seems that the cause of the exception is that you are searching for the RegionB in the main region manager instead of the scoped one: The RegionB is a scoped region inside the ViewA , so it will be register in the scoped region manager of the ViewA and not in the main one. Hence, in order to obtain the RegionB you need to access that region manager (lets call it RegionManagerA .)
As out of the box, Prism does not provide any functionality to access scoped region managers, so you will to implement your custom logic to store and retrieve them in order to use them later. How to implement this functionality will depend of the architecture of your application, its requirements and your personal preferences. For example, if you need to obtain the RegionB inside a controller, when injecting the ViewA and receiving its RegionManagerA you could also store the region manager in the controller (for example using an event) so that later the controller will be able to use it.
As a side note, if for example you need to obtain the RegionManagerA in the ViewModelA in order to inject or navigate to a view in the RegionB , I believe you could find the RegionManagerAwareBehavior I developed for the following blog post interesting:
Although, the behaviors was initially designed for other purposes, it allows a view / view model to find their corresponding view model in the visual tree. Hence, it can be useful to obtain the RegionManagerA inside the ViewModelA .
These same concepts can be also applied for sub-nested regions and views.
I hope this helps,
Damian Cherubini
http://blogs.southworks.net/dcherubini
Based on your description it seems that the cause of the exception is that you are searching for the RegionB in the main region manager instead of the scoped one: The RegionB is a scoped region inside the ViewA , so it will be register in the scoped region manager of the ViewA and not in the main one. Hence, in order to obtain the RegionB you need to access that region manager (lets call it RegionManagerA .)
As out of the box, Prism does not provide any functionality to access scoped region managers, so you will to implement your custom logic to store and retrieve them in order to use them later. How to implement this functionality will depend of the architecture of your application, its requirements and your personal preferences. For example, if you need to obtain the RegionB inside a controller, when injecting the ViewA and receiving its RegionManagerA you could also store the region manager in the controller (for example using an event) so that later the controller will be able to use it.
As a side note, if for example you need to obtain the RegionManagerA in the ViewModelA in order to inject or navigate to a view in the RegionB , I believe you could find the RegionManagerAwareBehavior I developed for the following blog post interesting:
Although, the behaviors was initially designed for other purposes, it allows a view / view model to find their corresponding view model in the visual tree. Hence, it can be useful to obtain the RegionManagerA inside the ViewModelA .
These same concepts can be also applied for sub-nested regions and views.
I hope this helps,
Damian Cherubini
http://blogs.southworks.net/dcherubini