private void OpenAdminWindow(string username) { this.Dispatcher.Invoke(() => { Windows.AdminWindow adminWindow = new Windows.AdminWindow(GetUsername()); adminWindow.Show(); this.Close(); }); }