private void Button_Add_Click(object sender, RoutedEventArgs e) { var window = new UserDialogWindow(); Close(); window.Show(); }
private void Button_Edit_Click(object sender, RoutedEventArgs e) { int id = listUser.SelectedIndex; var user = (User)listUser.SelectedItem; if (id == -1) { MessageBox.Show("Выберите пользователя"); } var window = new UserDialogWindow(user); Close(); window.Show(); }