public Deck ResetDeck(Deck deck) { var result = Decks.Single(d => d.Id == deck.OriginalId).AsCopy(); if (deck.IsSelected) { SelectedDeck = result; } return(result); }
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); }