Getting a list of loaded modules from PRISM in WPF

Topics: Prism v2 - WPF 3.5
Dec 3, 2009 at 6:14 AM

I have a WPF application built on top of PRISM.

When the user tries to close the application I need to check the dirty status of any loaded views.

I was hoping to enumerate a list of the loaded modules and ask them in turn whether it's OK to exit and save any changes, but I'm having trouble finding a list of references to the loaded modules.

The closest I could find was IModuleCatalog which gives me a list of modules, but not the actual object references these modules

Any suggestions on how I can do this?

Thanks in advance


Dec 7, 2009 at 4:37 PM

Hi Ian,

The IModulesCatalog provides a list of modules and not a reference to the actual modules as this would break the decoupling between the modules (which is one of the main reasons for building modular applications).

Not long ago, Brian Noyes blogged about a possible approach to save “dirty views” before closing the application. You can read about that in part1 and part2.

Please let me know if this helps.

Damian Schenkelman