I'm trying to load a catalog from XAML in WPF. I've done this successfully in Silverlight (mainly because the example's in the ref docs were for Silverlight) however when I try to do the equivalent in WPF I get the following error when the Boostrapper
trys to load a module from the XAML derived catalog:
There is currently no moduleTypeLoader in the ModuleManager that can retrieve the specified module.
Here's what I have for the catalog (Catalog.xaml):
ModuleType="MyNamespace.MyModule, MyNamespace" />
It's loading OK from here (in the Bootstrapper):
protected override IModuleCatalog GetModuleCatalog()
var uri = new Uri("/Catalogs/Catalog.xaml", UriKind.Relative);
var catalog = ModuleCatalog.CreateFromXaml(uri);
A breakpoint shows that the catalog is actually loaded, and contains one item. The exception is thrown from within
public partial class App : Application
protected override void OnStartup(StartupEventArgs e)
// Exception thrown from here.
Can someone point out what I'm doing wrong here. Am I not declaring the XAML correctly? Thanks.
PS: My module works fine when declared within App.config and bootstrapped via the 'ConfigurationModuleCatalog'. However I want to do this via XAML so I have more control at time of boostrapping. That is to say I want to decide
to load different sets of modules defined in different XAML catalogs based on the startup criteria. Is that a sensible plan? Or is there a better strategy to deal with this kind of behavior? Thanks again.