private void NextRoundButton_Click(object sender, RoutedEventArgs e) { Page nextPage = null; List<Participant> correctParticipants = Round.ParticipantAnswers.Where(a => a.WasCorrect ?? false).Select(a => a.Participant).ToList(); if (correctParticipants.Count == 1 && !Round.Question.TestQuestion) { nextPage = new WinnerPage(correctParticipants[0]); } else { List<Participant> participantsToCarryOver = correctParticipants; if (correctParticipants.Count == 0 || Round.Question.TestQuestion) { participantsToCarryOver = Round.ParticipantAnswers.Select(a => a.Participant).ToList(); } nextPage = new RoundPage(RoundGenerator.Next(participantsToCarryOver)); } if (NavigationService != null) { NavigationService.Navigate(nextPage); } }
private void NextRoundButton_Click(object sender, RoutedEventArgs e) { Page nextPage = null; List <Participant> correctParticipants = Round.ParticipantAnswers.Where(a => a.WasCorrect ?? false).Select(a => a.Participant).ToList(); if (correctParticipants.Count == 1 && !Round.Question.TestQuestion) { nextPage = new WinnerPage(correctParticipants[0]); } else { List <Participant> participantsToCarryOver = correctParticipants; if (correctParticipants.Count == 0 || Round.Question.TestQuestion) { participantsToCarryOver = Round.ParticipantAnswers.Select(a => a.Participant).ToList(); } nextPage = new RoundPage(RoundGenerator.Next(participantsToCarryOver)); } if (NavigationService != null) { NavigationService.Navigate(nextPage); } }