コード例 #1
0
        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();
        }
コード例 #2
0
 private void addUser_Click(object sender, RoutedEventArgs e)
 {
     /*
         UI blocking AddUser Window
     */
     AddUser userTab = new AddUser();
     userTab.Show();
 }