Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to show a shell only once all the modules have been loaded?

Tags:

c#

.net

wpf

prism

I'm currently working on an application which uses PRISM 4 to divide its functionalities in different modules.

I noticed that my application's Shell, which holds the modules' views in its regions, is loaded and displayed before the modules are loaded.

This means that the Shell is displayed first, and a considerable amount of time later (about half a second), the modules are loaded and the views inserted into the Shell's regions. It's rather annoying, as the user is greeted with an empty shell at start-up, which isn't very professional.

Is there any way to detect when all the modules have been loaded ? Any method I can override in the bootstrapper ?

If I could, I would like to hide the Shell (or display a loading adorner) until all the modules have been loaded.

like image 814
Hussein Khalil Avatar asked Sep 29 '11 13:09

Hussein Khalil


People also ask

What does module purge do?

"module purge" command will unload all modules from user's environment. To see the list of all available modules, issue "module spider" command.

How do you unload all loaded modules?

Modules can be removed using the rmmod command but demand loaded modules are automatically removed from the system by kerneld when they are no longer being used. Every time its idle timer expires, kerneld makes a system call requesting that all unused demand loaded modules are removed from the system.

How do you check if a module is loaded or not?

Under Linux use the file /proc/modules shows what kernel modules (drivers) are currently loaded into memory.

How do you check if a driver is loaded in Linux?

Run the command lsmod to see if driver is loaded. (look for the driver name that was listed in the output of lshw, "configuration" line). If you did not see the driver module in the list then use the modprobe command to load it.

Which command will display modules that have been loaded in your shell?

List all available modules by executing “ module avail ” command. The results are a list of module names that can be loaded.


1 Answers

You can show your Shell view after Modules are initialized:

protected override void InitializeShell()
{
   Application.Current.MainWindow = (Window)Container.Resolve<ShellView>();
}

protected override void InitializeModules()
{
   base.InitializeModules();
   Application.Current.MainWindow.Show();
}
like image 193
Ondrej Avatar answered Sep 20 '22 10:09

Ondrej