When to do one time application initialization in Prism 4?

Topics: Prism v4 - Silverlight 4
Feb 26, 2011 at 5:23 AM

I am working on a Silverlight application that uses Prism 4 and MEF. I need to call a web service during application startup to get some lookup and configuration data? What's the recommended location for making this call? I was thinking either some method of the MefBootstrapper or inside Application_Startup( ) (after the bootstrapper has run completely).

Feb 28, 2011 at 5:09 PM


There is no guidance in Prism regarding how or when to call web services. However you could place your services in a module and add it to the catalog.

In this module, when you have finished loading your data asynchronously you could use the Module Manager to load another module or for example publish an event using the Event Aggreagator in order to communicate with other modules to perform necessary operations accordingly.

Additionally, you might find this thread handy in order to achieve your requirement:

Best practice when calling services via proxy

I hope you find this information useful.


Miguel Bronzovic

Mar 1, 2011 at 1:00 AM

Thanks Miguel - this is very helpful. My web service happened to be in an infrastructure project and not in a module. However, based on your suggestion, I called it from the module that depended on it (during its initialization). So everything is working well now.

Thanks again!