Reminder registration is done in much the same way as for Alarm
objects. The reminder is instantiated and then registered with the ScheduledActionService
. With reminders, however, you are able to provide a URI that allows you to deep link back to a particular page within the app, as shown in the following excerpt:
Reminder reminder = new Reminder("ReminderName")
{
BeginTime = DateTime.Now.AddMinutes(5),
ExpirationTime = DateTime.Now.AddDays(5),
Content = "Your daily reminder.",
RecurrenceType = RecurrenceInterval.Daily,
NavigationUri = new Uri("/ReminderView.xaml?Id=ReminderName",
UriKind.Relative),
Title = reminderTitle
};
if (ScheduledActionService.Find(reminder.Name) != null)
{
ScheduledActionService.Remove(reminder.Name);
}
ScheduledActionService.Add(reminder);
The following section looks at creating a page that allows you to experiment with reminders.
18.191.223.123