Receiving a Toast Notification from Within an Application

,

The HttpNotificationChannel.ShellToastNotificationReceived event is used to receive toast notifications within your app, like so:

channel.ShellToastNotificationReceived +=
          channel_ShellToastNotificationReceived;


Note

Toast notifications are displayed only when your app is not running in the foreground. If your app is running in the foreground, the toast notification can still be received and handled in code.


When the ShellToastNotificationReceived event is raised, the handler receives a NotificationEventArgs object from which the relevant toast notification fields can be extracted, as shown:

void channel_ShellToastNotificationReceived(object sender,
                                            NotificationEventArgs e)
{
    string text1 = e.Collection["wp:Text1"];
    string text2 = e.Collection["wp:Text2"];
    //...
}

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.255.24