ConfigureServiceLocator

Topics: Prism v4 - WPF 4
Mar 9, 2011 at 2:22 PM

Can someone explain when I should be using the override ConfigureServiceLocator?  I currently load my Modules in ConfigureModuleCatalog, and the assemblies in ConfigureAggregateCatalog.  Should I be loading my services in the service locator?

Developer
Mar 9, 2011 at 4:48 PM
Edited Mar 9, 2011 at 4:49 PM

Hi,

The ConfigureServiceLocator method is overrided in the MefBootstrapper and UnityBootstrapper to set up the LocatorProvider for the ServiceLocator.

In order to make your services available to the ServiceLocator, you simply have to register them in the container or exporting it with MEF (or any other means of registering it, depending of the Dependency Injection mechanism you're using) with the corresponding interface mapping, in order to define it as a shared service. You can read more about shared services in this chapter from the Prism MSDN documentation.

I hope you find this helpful.

Guido Leandro Maliandi
http://blogs.southworks.net/gmaliandi