public static void OpenAddUserDialog() { /* Starts a new Add user window on a separate UI thread */ Thread thread = new Thread(() => { AddUser adduser = new AddUser(); adduser.Closed += (sender, e) => { adduser.Dispatcher.InvokeShutdown(); DataStore.handle1.Set(); AddUserRunning = false; }; adduser.Show(); System.Windows.Threading.Dispatcher.Run(); }); thread.SetApartmentState(ApartmentState.STA); thread.Start(); }
private void addUser_Click(object sender, RoutedEventArgs e) { /* UI blocking AddUser Window */ AddUser userTab = new AddUser(); userTab.Show(); }