Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void ShowSplashScreen()
- {
- var mainDispatcher = Dispatcher.CurrentDispatcher;
- var splashScreenThread = new Thread(() =>
- {
- new SplashScreen().Show();
- _splashScreenThreadDispatcher = Dispatcher.CurrentDispatcher;
- Dispatcher.Run();
- });
- splashScreenThread.SetApartmentState(ApartmentState.STA);
- splashScreenThread.Start();
- }
- private void CloseSplashScreen()
- {
- _splashScreenThreadDispatcher.InvokeShutdown();
- }
- var mw = new MainWindow();
- Application.Current.MainWindow = mw;
- mw.Show();
- CloseSplashScreen();
- mw.Activate();
Add Comment
Please, Sign In to add comment