private void Remove_Click(object sender, RoutedEventArgs e) { if (RightListBox.IsKeyboardFocusWithin) { TeamOb.Remove((Person)RightListBox.SelectedItem); } else if (LeftListBox.IsKeyboardFocusWithin) { TeamOb.RemoveAt(LeftListBox.SelectedIndex); } else { MessageBox.Show("Ничего не выбрано", "Сообщение", MessageBoxButton.OK, MessageBoxImage.Error); } }
private void RemoveCommandHandler(object sender, ExecutedRoutedEventArgs e) { team.RemoveAt(this.teamObservableListBox.SelectedIndex); }