Basic concepts and how to implement them

Topics: Prism v2 - Silverlight 3
Oct 28, 2009 at 3:38 PM

We're trying to register a view (RegisterMeView) with a region (PutViewHereRegion).  The PutViewHereRegion region is in a view that is in module A and the RegisterMeView View is in module B.

When we've had to use objects from one module in another module in the past we just publish and subscribe with a IEventAggregator.  I suppose I could do this here too, but it just doesn't seem correct.  It seems to me that I should be able to tell Prism's ModuleCatalog that a module exists and do all the stuff that's needed and then, when I need to register, the ModuleCatalog could load what it needs in order to put the view where it needs to be.  I haven't seen anything obvious in the documentation, but I don't understand it all, so I might just be missing something elementary.

Does Prism handle views special-like with the  ModuleCatalog or RegionManager, or are views just objects that I use the EventAggregator for?  Or maybe my basic understanding is flawed, and I'm going about everything wrong...

Oct 28, 2009 at 4:20 PM

You can get IRegionViewRegistry from the container, call its RegisterViewWithRegion (<string - region name>, <Type - your view type>)...  the region doesn't have to exist at the point of this call...


Oct 28, 2009 at 4:51 PM


    So you're saying that I should register my view in my moduleInit with a region, and then, in the other moduleInit when I create that region it will show up?  I'm trying this, and it kind of works, but it's a little sketchy.


I think it'll give me something to build on though, and I can keep moving from here.  Thanks a lot for your time!