private void Button_Home(object sender, RoutedEventArgs e) { HomeWindow w = new HomeWindow() { Owner = this }; w.ShowDialog(); w.Close(); }
private void Application_Startup(object sender, StartupEventArgs e) { //Recent Projects Global.rp = new DataManagementSystem.DMS <RecentProjects>("GaugeGenRP", ref Global.rp_container, AppDomain.CurrentDomain.BaseDirectory + RP_FILE); Global.rp.FileUpdated += FU; Global.rp.LoadFromSource(); #if !DEBUG //Splash screen SplashWindow splash = new SplashWindow(); splash.Show(); Stopwatch timer = new Stopwatch(); timer.Start(); timer.Stop(); int remainingTimeToShowSplash = SPLASH_TIME - (int)timer.ElapsedMilliseconds; if (remainingTimeToShowSplash > 0) { Thread.Sleep(remainingTimeToShowSplash); } #endif MainWindow w = new MainWindow(); Global.mainwindowobj = w; if (e.Args.Length > 0) { Global.LoadProject(e.Args[0], false); } w.Show(); #if !DEBUG splash.Close(); #endif if (Global.dms == null || Global.dms.PathToFile == "") { HomeWindow h = new HomeWindow() { Owner = w }; h.ShowDialog(); h.Close(); } }