Share via


ToastNotifier.Show(ToastNotification) Method

Definition

Displays the specified toast notification.

public:
 virtual void Show(ToastNotification ^ notification) = Show;
void Show(ToastNotification const& notification);
public void Show(ToastNotification notification);
function show(notification)
Public Sub Show (notification As ToastNotification)

Parameters

notification
ToastNotification

The object that contains the content of the toast notification to display.

Examples

The following example shows how to create and send a toast notification that includes text and images, including use of the Show method.

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");
textNodes[0].AppendChild(toastXml.CreateTextNode("Text input 1"));

var toast = new ToastNotification(toastXml);
notificationManager.CreateToastNotifier().Show(toast);

Applies to