Reputation: 24833
I have a WPF Desktop application using PRISM, there are 12 modules which do not depend on each other , every time i start the shell, modules are been loaded , the point is that I would like to know which module loads at the last so I could start an action. How could I determine this ?
Upvotes: 4
Views: 2185
Reputation: 8506
Expanding on erikH's answer (thank you, btw), assuming that you are deriving from the default UnityBootstrapper, here is the order in which the typically 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();
}
Note that this applies to PRISM 4 and 5
Upvotes: 0
Reputation: 2346
Override Bootstrapper.InitializeModules, call base, and then ACTION!
Upvotes: 9