Freigeben über


ToastNotifier.Show(ToastNotification) Methode

Definition

Zeigt die angegebene Popupbenachrichtigung an.

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)

Parameter

notification
ToastNotification

Das -Objekt, das den Inhalt der anzuzeigenden Popupbenachrichtigung enthält.

Beispiele

Das folgende Beispiel zeigt, wie Sie eine Popupbenachrichtigung erstellen und senden, die Text und Bilder enthält, einschließlich der Verwendung der Show-Methode.

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);

Gilt für: