public ResultsView(TestResults results) { if (results == null) throw new ArgumentNullException("results"); _results = results; InitializeComponent(); DataContext = results; App.Log.WriteLine(string.Format("Кончился тест {0}", results.Storage.Name)); App.Log.WriteLine(string.Format("Баллов {0}/{1}. Вопросов {2}/{3}", results.GotPoints, results.MaxPoints, results.CorrectCount, results.QuestionCount)); }
private void finish(object sender, RoutedEventArgs e) { if (MessageBox.Show("Точно?", "Всё что-ли?", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No) { return; } SaveState(); var answeredQuestions = _questions.Take(_maxIndex + 1).ToList(); var results = new TestResults { Storage = _storage, QuestionCount = _maxIndex + 1, MaxPoints = answeredQuestions.Sum(a => a.MaxPoints), GotPoints = answeredQuestions.Sum(a => a.GotPoints) }; App.MainWindow.Transition(new ResultsView(results)); }
private void finish(object sender, RoutedEventArgs e) { if (MessageBox.Show("Точно?", "Всё что-ли?", MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.No) return; SaveState(); var answeredQuestions = _questions.Take(_maxIndex + 1).ToList(); var results = new TestResults { Storage = _storage, QuestionCount = _maxIndex + 1, MaxPoints = answeredQuestions.Sum(a => a.MaxPoints), GotPoints = answeredQuestions.Sum(a => a.GotPoints) }; App.MainWindow.Transition(new ResultsView(results)); }