private async void CloseLongBreak_Click(object sender, RoutedEventArgs e) { try { LetItClose = true; if (App.Configuration.SaveStats) { App.Configuration.LongBreaksFailed++; App.Configuration.SaveSettingsToFile(); } await App.CurrentLongBreakWindow.HideUsingLinearAnimationAsync(); App.CurrentLongBreakWindow.Close(); App.CurrentLongBreakWindow = null; App.ShortBreakShownOnce = false; if (App.Configuration.ProtectionState == GuardStates.Protecting) { App.ShortBreakHandler.Start(); App.LongBreakHandler.Start(); } LongDurationCounter.Stop(); App.UIViewModels.HeaderMenu.ManualBreakEnabled = true; } catch { } }
private async Task EndLongBreak() { ((LongBreakWindow)CurrentLongBreakWindow).LetItClose = true; if (Configuration.SaveStats) { Configuration.LongBreaksCompleted++; UpdateStats(); } await CurrentLongBreakWindow.HideUsingLinearAnimationAsync(); CurrentLongBreakWindow.Close(); CurrentLongBreakWindow = null; ShortBreakShownOnce = false; if (Configuration.ProtectionState == GuardStates.Protecting) { ShortBreakHandler.Start(); LongBreakHandler.Start(); } LongDurationCounter.Stop(); UIViewModels.HeaderMenu.ManualBreakEnabled = true; }