protected override void OnStartup(StartupEventArgs e) { SplashScreen splash = new SplashScreen("Images/ShoeInventoryLogo.png"); splash.Show(false, true); Stopwatch timer = new Stopwatch(); timer.Start(); base.OnStartup(e); MainWindow main = new MainWindow(); timer.Stop(); Int32 remainingTimeToShowSplashScreen = MINIMUM_SPLASH_TIME - (Int32)timer.ElapsedMilliseconds; if (remainingTimeToShowSplashScreen > 0) Thread.Sleep(remainingTimeToShowSplashScreen); splash.Close(TimeSpan.FromMilliseconds(SPLASH_FADE_TIME)); main.Show(); }
protected override void OnStartup(StartupEventArgs e) { this._bootstrapper = new Bootstrapper(); this._service = this._bootstrapper.Container.Resolve<IApplicationService>(); SplashScreen splash = new SplashScreen("Images/ShoeInventoryLogo.png"); splash.Show(true); MainWindow main = new MainWindow(); main.Visibility = Visibility.Hidden; LoginWindow login = new LoginWindow(_service); login.ShowDialog(); base.OnStartup(e); splash.Close(TimeSpan.FromSeconds(1)); main.Visibility = Visibility.Visible; main.Show(); }