// Remove a word from the database and collections. public void DeleteWord(Word wordForDelete) { // Remove the word from the "all" observable collection. AllWords.Remove(wordForDelete); NeedableWord.Remove(wordForDelete); // Remove the word from the data context. // Remove the word from the appropriate category. switch (wordForDelete.isKnown()) { case true: KnownWords.Remove(wordForDelete); break; case false: UnKnownWords.Remove(wordForDelete); break; default: break; } dictionaryDB.Words.DeleteOnSubmit(wordForDelete); // Save changes to the database. dictionaryDB.SubmitChanges(); }