private static void NewWindow(bool newDispatcher) { if (newDispatcher) { Thread thread = new Thread(new ThreadStart(NewDispatcherWindow)); thread.SetApartmentState(ApartmentState.STA); thread.Start(); } else { var mainWindow = new MainWindow(); mainWindow.Show(); } }
private static void NewDispatcherWindow() { MainWindow newWindow = new MainWindow(); newWindow.Show(); Dispatcher.Run(); }