Toast Templates
As with live tiles and badges, toast notifications are defined by simple XML templates. For example, the following method can be invoked at any time to trigger a toast notification, with differences from live tiles and badges highlighted:
void SendToast() { // create a string with the toast template xml string xmlString = @" <toast> <visual> <binding template='ToastText01'> <text id='1'>Alert!</text> </binding> </visual> </toast>" ; // Load the content into an XML document XmlDocument document = new XmlDocument(); document.LoadXml(xmlString); // Create a toast notification and send it ToastNotification notification = new ToastNotification(document); ToastNotificationManager ...
Get Universal Windows® Apps with XAML and C# Unleashed 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.