private void _testController_TestEnd(object sender, TestEndEventArgs e) { _UpdateTimer.Stop(); Dispatcher.Invoke(() => { SetTestArea(string.Empty); EntryBox.Clear(); TimeLabel.Content = "0:0"; }); }
private void _uiUpdateTimer_Tick(object sender, EventArgs e) { TestTelemetry testTelemetry = _testController.GetCurrentTelemetry(); SetTestArea(_testString); if (_clearEntryBox) { EntryBox.Clear(); _clearEntryBox = false; } if (_mistakeMade) { EntryBox.SelectionStart = EntryBox.Text.Length; EntryBox.SelectionLength = 0; _mistakeMade = false; } SpeedLabel.Content = string.Format("{0} WPM", testTelemetry.WPM); TimeLabel.Content = string.Format("{0}:{1}", testTelemetry.ElapsedTime.Minutes, testTelemetry.ElapsedTime.Seconds); }