void ToastButton_Click(object sender, RoutedEventArgs e)
{
//Initialize
the toast xml, using a predefiend type.
var ToastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText01);
//extract
all the text elements
var toastTextElements = ToastXml.GetElementsByTagName("text");
//set
the one text element we have to a value
toastTextElements[0].AppendChild(ToastXml.CreateTextNode("Woot Woot!!!"));
//create
the toast
var Toast = new ToastNotification(ToastXml);
//show
the toast in the top right corner
ToastNotificationManager.CreateToastNotifier().Show(Toast);
}
Now we can actually add a Failed, Dismissed and activated handlers to our toast for some richer interaction
//create
the toast
var Toast = new ToastNotification(ToastXml);
Toast.Activated +=
Toast_Activated;
and then create an event handler to do some stuff
void Toast_Activated(ToastNotification sender, object args)
{
//Do
some stuff
}
in short that's about it, pretty straight forward.