In this article we will see how to create an Alarm and a Reminder in Windows Phone. Creating Alarm
You can find explanations of properties as below. The Alarm class is inherited from the ScheduleNotification class. Some of the properties are inherited from the base class. An Alarm can be created as below: var newAlaram = new Alarm("myalarm") { Content="Hey Office Time", BeginTime= DateTime.Now.AddMinutes(2), RecurrenceType = RecurrenceInterval.Daily, ExpirationTime = DateTime.Today.AddDays(30), // sound= new Uri("music1.wav",UriKind.Relative) }; ScheduledActionService.Add(newAlaram); In the code shown above, the last line adds the alarm to the phone. The ScheduledActionService class add method is used to add an alarm to the phone. On running you should be getting an alarm after 2 minutes as below: The best practice is to give the name of the alarm as a GUID. Since the name of the alarm must be unique in the application and it is not visible to the user so it should be given the name as GUID. Creating Reminder
Various properties of a Reminder are explained below: A Reminder can be created as below: Reminder reminder = new Reminder("myreminder") { Title = "Debugmode app reminder", Content = "Hey Go to party", BeginTime = DateTime.Now.AddMinutes(2), RecurrenceType = RecurrenceInterval.Daily, ExpirationTime = DateTime.Today.AddDays(30), NavigationUri = new Uri("Page1.xaml", UriKind.Relative) }; ScheduledActionService.Add(reminder); In the above code, the last line adds the reminder to the phone. The ScheduledActionService class method is used to add reminders to the phone. On running you should be getting a reminder after 2 minutes as below: On tapping, the user will be navigated to Page1.xaml. This is how you can create and schedule an Alarm and a Reminder in Windows Phone. I hope this article is useful. Thanks for reading.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: