Load Module on Demand

Topics: Prism v4 - Silverlight 4
Jul 19, 2011 at 11:06 AM
Edited Jul 19, 2011 at 11:07 AM

Dear All,

I have succesfully loaded my modules when required (so fine).

Is there a way to detect if the module is already loaded or not ...!?

Best regards

Waleed

Jul 19, 2011 at 6:21 PM

I have created bool properities to implement that .. is there any better approach ..?

Regards

Waleed

Developer
Jul 19, 2011 at 6:58 PM
Edited Jul 19, 2011 at 7:03 PM

Hi Waleed,

Based on my understanding, you want to know when a module has finished loading.

To accomplish this, you can use the ModuleManager which exposes an LoadModuleCompleted event that is raised when a module is loaded or fails to load.

You can find more information regarding this in Chapter 4: Modular Application Development of the Prism documentation.

I hope you find this helpful.

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

Jul 20, 2011 at 9:17 AM

Hello Guido,

Actually No, I have done that.

What I need is to know if user selects an option another time (not first time) I need to check if its module has been loaded before or not.

Regards

Waleed

Developer
Jul 20, 2011 at 2:11 PM

Hi Waleed,

The approach you've mentioned seems to be correct. As neither the ModuleCatalog nor the ModuleManager provide any means of accessing the list of modules that have already been loaded (versus the modules that are just present in the catalog), the approach I'd follow for obtaining this would be to have a custom service that manages that, responding to the ModuleManager.LoadModuleCompleted event and using the ModuleCatalog.Modules enumeration to have a notion of the total of modules present in the catalog.

I hope you find this helpful.

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

Jul 20, 2011 at 3:49 PM

Thanks Guido,

Appreciate your reply

Regards