Silverlight PRISM, displaying/hiding modules dynamically

Topics: Prism v2 - Silverlight 3
Sep 23, 2009 at 1:44 PM


I have created a project using the PRISM framework. I have a few modules that I can register and display in the shell and this works fine. What I need to do is dynamically display and hide the modules when a particular event is received from the event aggregator.

I fire off a DisplayModule event that should be received and hide an existing module and show a new one, but my question is where is the place I should receive this event and display the module? the shell? if so, how would I do this as the shell is the top level and doesn't seem to inherit the required Unity methods.

I also thought I could have a seperate module that listened for the DisplayModule event and used the region manager to hide the previous module and show the new one. This would need to reference all other modules to be able to resolve their type though, is this bad practice?

Hope that makes sense.

Thankyou for your time

Sep 24, 2009 at 6:10 PM


The following threads deal with similar situations and explain possible ways of achieving your goals:

Please let me know if this helps.

Damian Schenkelman