Do not display shell on startup

Apr 22, 2010 at 5:47 PM
Edited Apr 22, 2010 at 5:47 PM

Hello friends,

I want to hide shell on start up. Is it possible in CAL for WPF?

Kshamesh

Apr 23, 2010 at 3:45 PM

Hi Kshamesh,

Not showing the Shell is perfectly possible (I assume you are using WPF). As the Bootstrapper is in charge of creating the Shell in a Prism application, you simply don’t have to call the Shell’s Show method (assuming it is a window). For example:

protected override DependencyObject CreateShell() 
       { 
           Shell shell = new Shell(); 
           //shell.Show(); 
           return shell; 
       }

Please let me know if this helps.

Damian Schenkelman
http://blogs.southworks.net/dschenkelman

Apr 25, 2010 at 7:18 AM

Hi Damian,

Thank you for your inputs. :-)

Yes, I am using WPF. I have tried commenting //shell.Show();

It helped me to hide shell on start up. However, I couldn't see my next module loaded on screen which is supposed to be.

Do I require to write some code in my module, to show the shell again along with my module?

Kshamesh

May 12, 2010 at 4:44 PM

Hi Kshamesh,

Sorry for the delayed response. Since you have not shown the Shell in the CreateShell method, you will have to call the its Show method to get it displayed.

For example, a possible approach to get this done could be subscribing to an event in the Shell presenter/view model, and showing the Shell in the event handler. The event could be published when a particular view is added to a region, and the Shell will be shown once the view has been added.

Please let me know if this helps.

Damian Schenkelman
http://blogs.southworks.net/dschenkelman

May 18, 2010 at 12:12 PM
Edited May 18, 2010 at 12:17 PM

Hi Damian,

Even, I was away from work for few days :-) I can update you after I try your suggestion.

Thank you.

Kshamesh