Pop a simple, local toast notification

Eliot  Eliot Cowley, Content Developer

Here is how to create a text-only local toast notification in a Windows 10 UWP app.

using Windows.Data.Xml.Dom;
using Windows.UI.Notifications;
using Windows.UI.Xaml.Controls;

private static void ShowToast(string title, string content)
 XmlDocument toastXml = new XmlDocument();
 string xml = $@"
  <toast activationType='foreground'>
    <binding template='ToastGeneric'>
 ToastNotification toast = new ToastNotification(toastXml);

See also

Comments (1)

Skip to main content