Two Shell problem ?

May 20, 2009 at 7:48 PM

I have a strange problem .  when i compile my solution , I got 2 shells ? can anyone help me where could be the problem ? I followed the Stocktrader implementation as reference project ...

Thanks !

//Kumar

May 21, 2009 at 8:26 PM

Hi Kumar,

 

One possible reason for this to be happening could be that the Application class has the StartupUri attribute set (to Shell.xaml or the name of your shell).

<Application x:Class="HelloWorld.App"

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

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

StartupUri="Shell.xaml">

 

Thus, since the bootstrapper creates and shows an instance of the shell, and the StartupUri does the same thing (but without attaching RegionManagers), you will have two Shells.

 

If this is the case the following document from the Prism-v2 documentation might be useful for you (assuming you are using Prism-v2 WPF):

·         How to: Create a Solution Using the Composite Application Library for WPF

 

If this is not your scenario, please send more information to try and reproduce the issue.

 

Please let me know if this helps.

 

Damian Schenkelman

http://blogs.southworks.net/dschenkelman

May 21, 2009 at 11:48 PM

Hi Damian,

That's the problem , I forgot to remove the startupuri value  in App class ! 

Thank you very much ! 

 

//Kumar

 

Sep 9, 2009 at 9:24 AM

I had a similar problem but the cause was different.

I tried to create view dynamically and add it to region using region.Add/Activate. The view wouldn't show up. The problem was in my Bootstrapper code and you can see the solution in the"Activate does not show the view" thread at http://compositewpf.codeplex.com/Thread/View.aspx?ThreadId=68221