tags:

views:

35

answers:

1

In my bootstrapper I have the following code to create my Directory ModuleCatalog

protected override IModuleCatalog CreateModuleCatalog()
{
    DirectoryModuleCatalog catalog = new DirectoryModuleCatalog();
    catalog.ModulePath = @".\Modules";
    return catalog;
}

but all my modules seem to be loading when the shell gets created. How can I load them on demand while still using the DirectoryModuleCatalog?

A: 

Hi,

I don't remember the exact name, but in Prism v2 there were attributes that were placed on classes that implemented IModule to mark the modules to load on demand.

Check the Prism docs for their name.

EDIT: Just checked the Prism code. The class name for the attribute is ModuleAttribute and the usage is the following:

[Module(ModuleName = "MyModule", OnDemand = true)]
public class MyModule : IModule
{
   ...
}

Thanks, Damian

Damian Schenkelman