//When finish button is triggered, creates results window. private void Finished(object sender, RoutedEventArgs e) { if (exerciseObj == null) { throw new Exception("No exercise tracked"); } else { //Open new window var results = new ResultsWindow(exerciseObj.GetContent()); results.Show(); } }
//Triggers finish button when speech is recognised. private void SpeechRecognized(object sender, SpeechRecognizedEventArgs e) { // Speech utterance confidence below which we treat speech as if it hadn't been heard const double ConfidenceThreshold = 0.3; if (e.Result.Confidence >= ConfidenceThreshold) { if (exerciseObj == null) { throw new Exception("No exercise tracked"); } else { var results = new ResultsWindow(exerciseObj.GetContent()); results.Show(); } } }