RegisterViewWithRegion Question

Topics: Prism v2 - Silverlight 3
Dec 21, 2009 at 10:39 PM

I've read all the doc (multiple times) and I believe I understand the difference between View-Discovery and View-Injection.  With View-Injection I can add many views to a particular region and I'm able to activate them by view-name.  With View-Discovery I'm telling Prism up front what view (or delegate that returns a view) maps to a particular region up front.  This seems to only support registering a single view to a region (note IRegionManager.RegisterViewWithRegion does NOT allow a ViewName as an argument).  I would like to have a way to tell Prism up front about many views that might be activated, and have a means for doing so by ViewName.  If this is by design, then I think a better name would be View-Defaulting.

Am I missing something?  If I'm forced to do this with View-Injection then from what I can tell, I'm going to have to rewrite/wrap a large portion of the IRegion/IRegionManager infrastructure to do this (keeping a list of Func<object>'s and manually adding/activating views within a region).  

Any advice would be appreciated.

Jan 4, 2010 at 5:55 PM


With Prism’s out of the box functionality, using View Discovery, you can register more than one view with the same region. On the other hand, I have created a blog post that provides a way to register views in regions providing the view name. You can find it in the link below:

Please let me know if this helps.

Damian Schenkelman