locked
Show A Splash Screen On Startup RRS feed

  • General discussion

  • Hello All,

    I'm trying to load a splash screen on start before I load my main window.  But, it doesn't seem to work.  I don't get an error or anything.  The splash screen loads fine but the main windows doesn't show at all.  See the code below, and thanks in advance.

    <Application x:Class="ADT_Suite_WPF.App"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 Startup="Application_Startup">
        <Application.Resources>
             
        </Application.Resources>
    </Application>
    

     private void Application_Startup(object sender, StartupEventArgs e)
            {
                try
                {                
                    winSplash wSplash = new winSplash();
                    wSplash.ShowDialog();
    
                    MainWindow wMain = new MainWindow();
                    wMain.ShowDialog();
                }
                catch (Exception X)
                {
                    MessageBox.Show(X.ToString());
                }
            }

    Wednesday, March 16, 2016 2:34 PM

All replies

  • Check your app ShutDownMode.  It is most likely "on last window close".  This means that you create splash screen and then close it.  Bye bye.  Change it to "on main window close".

    Lloyd Sheen

    Wednesday, March 16, 2016 2:58 PM