PRISM Dynamically plug - unplug modules

Topics: Prism v4 - Silverlight 4
Feb 9, 2011 at 6:47 AM

Hi All,
I have to build application which you can think is very much similar to Outlook. However I need to dynamically add / remove modules without making code changes. I should be able to do this with few configuration changes and new module is plugged into application. Say for instance in Outlook today I have only Mail and Calendar module. Now I want to add Contact module which is developed seperately. All I want is to copy the XAP in client bin and make some configuration changes and application show be up and running with Contacts module added in left panel.

As of now to achieve above I have to make changes in ModuleCatalog.xaml and add region in Shell. With this I have to build and deploy complete app for every plug and unplug of module.
For dynamically adding module, I should be able to read the some configuration and based on number of modules I will add regions dynamically in my left panel. Right panel will have only Main Region to display module specific views.

Please let me know if this is achievable.


Feb 9, 2011 at 3:33 PM

Hi Abhilash,

Based on my understanding of your scenario, you could achieve this functionality using Regions and Modules loaded on demand to satisfy your configuration settings. You can read about these features in the following links:

Additionally, regarding the rebuild and deploy every time you add or delete a module from your application, as Prism documentation shows: “Silverlight does not support using configuration files. If you want to use a configuration-style approach for Silverlight, the recommended approach is to create your own ModuleCatalog that reads the module configuration from a web service on the server”. You can read this thread where a similar approach is covered.

I hope you find this information useful.


Miguel Bronzovic