public void UpdateDeck(Deck deck) { var old = Decks.Single(d => d.Id == deck.Id); if (old.Id == SelectedDeck.OriginalId) { SelectedDeck = deck.AsCopy(); } Decks[Decks.IndexOf(old)] = deck; db.UpdateDeck(deck); }