How can I find out if all my modules are loaded in prism 4?

I have a WPF Desktop application using PRISM, there are 12 modules that are independent of each other, every time I run the shell, the modules are loaded, the fact is that I would like to know which module is loaded on the last so that I could start an action. How can I determine this?

+4
source share
2 answers

Override Bootstrapper.InitializeModules, call base, and then ACTION!

+9
source

Turning around to erikH's answer (thanks, by the way), assuming you are extracting from UnityBootstrapper by default, here is the order in which commonly overridden methods are called:

//0 public override void Run(bool runWithDefaultConfiguration) { base.Run(runWithDefaultConfiguration); //this is our last opportunity to hook into the PRISM bootstrapping sequence; at this point every very other base-overridden //method has been executed } //1 protected override void ConfigureModuleCatalog() { base.ConfigureModuleCatalog(); ModuleCatalog moduleCatalog = (ModuleCatalog)this.ModuleCatalog; //add modules... } //2 protected override void ConfigureContainer() { base.ConfigureContainer(); //register everything with the container... } //3 protected override DependencyObject CreateShell() { return Container.Resolve<ShellView>(); //resolve your root component } //4 protected override void InitializeShell() { base.InitializeShell(); App.Current.MainWindow = (Window)Shell; App.Current.MainWindow.Show(); } //5 protected override void InitializeModules() { base.InitializeModules(); } 

Please note that this applies to PRISM 4 and 5

0
source

Source: https://habr.com/ru/post/1385168/


All Articles