How to check if module loaded?

Topics: Prism v4 - Silverlight 4
Oct 18, 2012 at 5:36 PM

I have some modules loaded by permission. Now i want to run/don't run some code based on the fact that module loaded or not loaded.

I have IModuleManager available to me but it doesn't have any of this information. Is there any place in PRISM where I can pull list of modules and loaded/not loaded status?

Oct 18, 2012 at 9:15 PM
Edited Oct 18, 2012 at 9:16 PM


I believe you could benefit of the IModuleCatalog implementation provided with Prism. As you may find the ModuleCatalog holds information about the modules that can be used by the application. This way in its Modules property you could find a collection of the ModuleInfo classes. This ModuleInfo classes will contain information of each module like the ModuleName and the ModuleState, which for example you could check to see if a module is "NotStarted" and react accordingly.

I hope you find this useful,

Agustin Adami