What’s Coming In Mango–Reminders

Mango From Scratch

One of the very cool features coming in Mango is Reminders, and more generally, scheduled tasks. Reminder  This allows you to set up a reminder and then exit the application.  When your reminder fires you have the opportunity to snooze the reminder or to enter the application. And if you enter the application you can enter not only at the home page, but also deep within the application at the relevant page for the reminder.

To get started, let’s strip down an example shown at Mix 11 by  Peter Torr to its absolute essence.  We’ll create a new Mango application and place a button which says “Remind Me” on the main page.  In the code behind, the click event handler for the button creates the Reminder (and passes in a name so that we can, if we choose, refer to the reminder programmatically). 

We then set the title of the reminder, the amount of time to wait for it to show itself (BeginTime) and a Uri for where to return to should the user click on the reminder.  Finally, we register the reminder with the ScheduledActionService which will manage all the reminders and alarms.  Here’s the code for the click event handler,

void Reminder_Click( object sender, RoutedEventArgs e )
{
   Reminder r = new Reminder( "Dinner" );
   r.Title = "Dinner";
   r.Content = "Time to eat dinner";
   r.BeginTime = DateTime.Now.AddSeconds( 10 );
   r.NavigationUri = NavigationService.CurrentSource;
   ScheduledActionService.Add( r );
}

To test the application click the button and then exit the application. About 10 seconds later the reminder will pop up and clicking on it will return you to the original page.

Share

About Jesse Liberty

Jesse Liberty is a Master Consultant for Falafel Software, and has three decades of experience writing and delivering software projects. He is the author of 2 dozen books and multiple Pluralsight courses, and has been a Technical Evangelist for Telerik and for Microsoft, a Distinguished Software Engineer for AT&T, a VP for Information Services for Citibank and a Software Architect for PBS.
This entry was posted in Mango, Mini-Tutorial and tagged . Bookmark the permalink.

5 Responses to What’s Coming In Mango–Reminders

  1. Sean Briscoe says:

    The Mango update really looks like it’s going to be a great release. Have you heard anything about when developers will get the Mango image to install on their unlocked phones? Microsoft has mentioned that we’ll get it before it releases to the public. Maybe we’ll hear more at their press conference on May 24th?

    • Mads Laumann says:

      Hi

      Great post Jesse :)

      @Sean Have MS actually said that officially that we will get an image to test our app’s before release? That would be great! We can test our app’s on the new version, MS will have the next version tested more throughly by developers before final release and we will be able to play around with the new stuff before others which is always nice :)

  2. Pingback: What’s Coming In Mango–Reminders « World Wide Code

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>