1
votes

I Have a Prism WPF Application using Unity as IoC-Container which contains a module called "LanguageModule":

My ShellViewModel requires a instance of this module. And my Shell requires a instance of the ShellViewModel.

But the CreateShell Method is called before my Modules are loaded. Am i doing something wrong?

Is it correct that my module adds itself to the Container (InitialzeCode:)?

container.RegisterInstance(typeof(ILanguageService), new LanguageServicePrototype());

How can i add my Language Service as a Module?

1

1 Answers

0
votes

CreateShell gets called before the other modules get initialized via the bootStrapper's call to InitializeModules.

So Rather than writing your own derived bootstrapper class to somehow get around this (if you can), I would refactor whatever you have in your shellViewModel (that depends on the language module) into a separate module of its own, and then setup a module dependency on your language module.