Jan 20, 2009 at 7:26 PM
Edited Jan 20, 2009 at 7:27 PM
To load a module on demand using the
DirectoryModuleCatalog class you do not need to add any extra code in the
Boostrapper class (you need to be sure that all modules assemblies are located in the
Generally, the code that loads a module on demand is executed in response to an event, like the user clicking in a button.
You need to add the following code to the class in charge of handling the event raised to load the module:
Get a reference to the Module Manager.
private readonly IModuleManager moduleManager;
public MyClass(IModuleManager moduleManager)
this.moduleManager = moduleManager;
When you want to load a module, execute the
LoadModule method of the Module Manager passing the module name (which is set through the ModuleName property of the ModuleAttribute) as a parameter.
// The user clicks in a button.
private void OnLoadModuleCClick(object sender, RoutedEventArgs e)
For more information related to this you can check the following:
The DirectoryLookupModularity Quickstart located in the
$Prism v2 – Drop 9 Path$\Quickstarts\Modularity\DirectoryLookupModularity folder.
The Development Activities -> How to: Load Modules On Demand topic in the documentation.
Please let me know if this helps.