示例#1
0
        private void EditUserButton_Click(object sender, RoutedEventArgs e)
        {
            var selected = Users.users[UserListBox.SelectedIndex];

            userInputName = NameBox.Text;
            userInputMail = EmailBox.Text;
            if (selected != null)
            {
                selected.Name = userInputName;
                selected.Mail = userInputMail;
                RefreshListBoxes();
                ClearTextFields();
                UserListBox.UnselectAll();
            }
        }
示例#2
0
 private void AdminListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     if (AdminListBox.SelectedItem != null)
     {
         UserListBox.UnselectAll();
         ClearTextFields();
         var selected = (AdminListBox.SelectedItem as Users);
         NameBox.Text  = selected.Name;
         EmailBox.Text = selected.Mail;
         RemoveAdminButton.IsEnabled = true;
     }
     else
     {
         RemoveAdminButton.IsEnabled = false;
     }
 }