So, what I need to get:
To trigger the alarm after it is installed.
What I get:
If the application is not closed, then the alarm clocks work as expected. But if the application is closed, the stack of these guns will be cleared. I checked it this way - I set the alarm, I was convinced of its work when the application was running, I started it again and closed the application, the response time comes, and there are no push notifications. Alarm clock so:
ToastContent content = new ToastContent() { Scenario = ToastScenario.Alarm, Visual = new ToastVisual() { TitleText = new ToastText() { Text = "Пора на работу!\n Начало в " + appointment.StartTime.ToString() } }, Audio = new ToastAudio() { Src = new Uri("ms-winsoundevent:Notification.Looping.Alarm") }, Actions = new ToastActionsCustom() { Buttons = { new ToastButtonSnooze(), new ToastButtonDismiss() } }, }; var toastNotifier = ToastNotificationManager.CreateToastNotifier(); ScheduledToastNotification stn = new ScheduledToastNotification(content.GetXml(), alarmTime, TimeSpan.FromMinutes(10), 3); stn.Id = appointment.AppointmentID; ToastNotificationManager.CreateToastNotifier().AddToSchedule(stn);