//Delete EventHandler that deletes only if there is any item in ObservableCollection. public void Delete_Click(object sender, EventArgs e) { int index = listContacts.SelectedIndex; if (index != -1) { c1.DeleteContact(index); } else { MessageBox.Show("List is Empty. Please add before deleting", "Unable to Delete", MessageBoxButton.OK, MessageBoxImage.Error); } }