O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Alarm Registration

As previously stated, registering an alarm is done via the ScheduledActionService. When using the ScheduledActionService, each notification must be given a unique name, or an exception is raised when you try to add it to the service. In the following example, we avoid reregistering a notification by detecting whether a notification with the same name has already been registered. We then use the ScheduledActionService class’s Add method to register the alarm, as shown:

Alarm alarm = new Alarm(alarmName){    BeginTime = DateTime.Now.AddDays(1),    Content = "A test alarm.",    RecurrenceType = RecurrenceInterval.None,    Sound = new Uri("/Sounds/Alarm.wma", UriKind.Relative),};if (ScheduledActionService ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required