protected override void OnStartup(StartupEventArgs e)
        {
            #region Splash Screen

            SplashScreen splash = new SplashScreen(Constants.SPLASH_SCREEN_FILE);
            splash.Show(false, true);

            base.OnStartup(e);

            // Step 2 - Start a stop watch
            Stopwatch timer = new Stopwatch();
            timer.Start();

            // Step 3 - Load your windows but don't show it yet
            base.OnStartup(e);

            // Step 4 - Make sure that the splash screen lasts at least two seconds
            timer.Stop();
            int remainingTimeToShowSplash = 1000 - (int)timer.ElapsedMilliseconds;
            if (remainingTimeToShowSplash > 0)
                Thread.Sleep(remainingTimeToShowSplash);

            // Step 5 - show the page
            splash.Close(TimeSpan.FromMilliseconds(300));

            #endregion

            HomePage main = new HomePage();

            if (Helper.IsDatabaseServerConfigured())
            {
                main.Show();
            }
            else
            {
                ConfigureDatabase configureDB = new ConfigureDatabase();
                configureDB.ShowDialog();
                if (configureDB.IsDatabaseReady)
                {
                    main.Show();
                }
            }
        }
 private void btnHome_Click(object sender, RoutedEventArgs e)
 {
     if (HomePageHandler == null)
     {
         HomePageHandler = new HomePage();
     }
     HomePageHandler.WindowState = System.Windows.WindowState.Normal;
     HomePageHandler.Activate();
     this.Close();
 }