Improving our application with toast notifications

Toasts notify the user of relevant and time-sensitive events such as the reception of a new e-mail or a reminder for an approaching appointment.

They will help our application to accomplish another of the Windows Store app principles, which is to feel connected and alive.

Getting ready

We will implement this recipe on the application that we have been developing, but we could apply what we are going to do to any Windows Store app.

How to do it...

Here we are going to add the capability of creating toasts to our app.

  1. Open the application and HelloPage.xaml.cs and add the following using namespaces:
    using Windows.Data.Xml.Dom;
    using Windows.UI.Notifications;
    Add there the following method: private void ...

Get Microsoft .NET Framework 4.5 Quickstart Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.