/// <summary> /// Callback to update the time dispay that the time calls each time it ticks /// </summary> private void UpdateTimeCallback(object?state) { if (Console.KeyAvailable) { switch (Console.ReadKey(true).KeyChar.ToString().ToUpper()) { case " ": _viewModel.StartStop(); break; case "R": _viewModel.Reset(); break; case "L": _viewModel.LapTime(); break; default: Console.CursorVisible = true; Console.CursorLeft = 0; Console.CursorTop = 5; _quit = true; break; } } WriteCurrentTime(); }
private void ResetButton_Click(object sender, RoutedEventArgs e) { _stopwatchViewModel.Reset(); }
private void Reset(object sender, EventArgs e) { viewModel.Reset(); }