public void Update() { if (targetSeconds - teaTimer.ElapsedSeconds() <= 0.0 && teaTimer.isRunning) { if (!App.IsInForeground) { notificationService.CreateNotification(timerViewModel.TeaName, timerViewModel.teaType, (int)infNum); } else { notificationService.CancelNotification(); } teaTimer.Clear(); timerViewModel.InfNum = infNum.ToString(); timerViewModel.formatTimerNum(0.0); timerViewModel.IsBusy = false; alarmPlayer.Play(); } if (teaTimer.isRunning) { timerViewModel.formatTimerNum(targetSeconds - teaTimer.ElapsedSeconds()); } }
/// <summary> /// Cancels a specific notification /// </summary> /// <param name="requestCode">The ID of the notification to cancel</param> public static void CancelNotification(int requestCode) { notification.CancelNotification(requestCode); }