CreateModuleCatalog redundant with UnityBootstrapper?

Topics: Prism v4 - WPF 4
Sep 3, 2014 at 5:46 PM
I noticed something peculiar today. My application has a custom ModuleCatalog that will load the module details from a service. Obviously, this is a long running process, so I made the load asynchronous and plan to run what needs to be run afterwards. I'm using an event to notify when it's complete (I haven't worked out the specifics of how that's going to work in my boostrapper yet).

What I noticed when I wired up my event in ConfigureModuleCatalog (I also tried it in CreateModuleCatalog) is that the handler is null when it gets time to be fired. Through a little work I determined that the IModuleCatalog returned by CreateModuleCatalog and modified in ConfigureModuleCatalog is not being used to load the modules. Instead a new instance of my ModuleCatalog class is being created. Obviously, the new one doesn't have the handler set, so nothing happens.

Additionally, even with this behavior you have to override CreateModuleCatalog; otherwise, you get an exception in the Run method of the bootstrapper.

Is this a bug, or am I missing something?