ToastNotification(XmlDocument) Constructor
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates and initializes a new instance of the ToastNotification.
public:
ToastNotification(XmlDocument ^ content);
ToastNotification(XmlDocument const& content);
public ToastNotification(XmlDocument content);
function ToastNotification(content)
Public Sub New (content As XmlDocument)
Parameters
- content
- XmlDocument
The XML content that defines the toast notification.
Examples
The following example shows how to create and send a toast notification that includes text and images, including use of the ToastNotification constructor.
var notificationManager = ToastNotificationManager;
var template = ToastTemplateType.ToastImageAndText01;
var toastXml = notificationManager.GetTemplateContent(template);
var images = toastXml.GetElementsByTagName("image");
images[0].SetAttribute("src", "images/toastImageAndText.png");
var textNodes = toastXml.GetElementsByTagName("text");
// Fill text nodes
textNodes[0].AppendChild(toastXml.CreateTextNode("Text input 1"));
var toast = new ToastNotification(toastXml);
ToastNotificationManager.CreateToastNotifier().Show(toast);
Applies to
See also
- Toast notifications sample
- Sending toast notifications from desktop apps sample
- Toast XML schema
- Tiles, badges, and notifications
- Quickstart: Sending a toast notification
- Quickstart: Sending a toast push notification
- Quickstart: Sending a toast notification from the desktop
- Guidelines and checklist for toast notifications
- How to handle activation from a toast notification
- How to opt in for toast notifications
- How to schedule a toast notification
- How to enable desktop toast notifications through an AppUserModelID
- The toast template catalog
- Toast audio options