Shell window opened twice

Sep 15, 2008 at 11:40 PM
I have probably some project settings wrong but the shell window is being opened twice every time i run the project.
I use this code to invoke shell window:
(it's in bootstrapper)
protected override DependencyObject CreateShell()
{
            Shell shell = Container.Resolve<Shell>();
            shell.Show();
            return shell;
}

This openes window with modules loaded in it but in a second after that another(empty this time) shows up.
What do i do wrong?

regards,
P.K.
Sep 16, 2008 at 12:26 PM

Hi

 

Did you removed the StartupUri attribute from the App.xaml file? You are manually instantiating the Shell window in your Bootstrapper class, so this attribute is not required.

 

To remove the StartupUri attribute follow this steps:

1.       Open the App.xaml file located in the project that contains the Shell.

2.       Remove the following attribute in the XAML:

 

StartupUri="Shell.xaml"

 

3.       The code in the App.xaml file should look like the following:

 

<Application x:Class="MyNamespace.App"

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<Application.Resources>

</Application.Resources>

</Application>

 

Please, let me know if it helps.

 

Mariano Converti

http://blogs.southworks.net/mconverti

Sep 16, 2008 at 12:58 PM
That was it...

Thanks a lot.

regards,
P.K.