/// <summary> /// Delete the given challenge from the database. /// </summary> /// <param name="Name">The name of the challenge.</param> public void DeleteChallenge(string Name) { if (Name == null) { throw new ArgumentNullException(); } // Remove it from the database. Challenges.DeleteChallenge(Name); // Update the challenge list. challengeList = Challenges.GetChallenges(); // Set a new current challenge. if (challengeList.Count == 0) { CurrentChallenge = ""; } else { // TODO: Can we assume that the last item in the list is the newest? CurrentChallenge = challengeList.Last(); } // We changed some of our public properties. NotifyPropertyChanged("ChallengeList"); // TODO: These are redundant to what was done in CurrentChallenge.set // so they can probably be deleted. NotifyPropertyChanged("CurrentChallenge"); NotifyPropertyChanged("SplitList"); }