I have the following code to show a toast notification locally in a C# / XAML Windows Store app:
private static void ShowToast(string message)
{
var toastXmlString = string.Format("<toast><visual version='1'><binding template='ToastText01'><text id='1'>{0}</text></binding></visual></toast>", message);
var xmlDoc = new Windows.Data.Xml.Dom.XmlDocument();
xmlDoc.LoadXml(toastXmlString);
var toast = new ToastNotification(xmlDoc);
ToastNotificationManager.CreateToastNotifier().Show(toast);
}
The toast is never shown in the UI. You can try it with an empty default VS 2012 Windows Store app project and this code. Is there something that needs to be configured first?
Make sure that you have "toast capable" set in the manifest.
hey and also make sure that you don't test your app in simulator mode (you need to use the Local Machine mode)! it took me 20 minutes to figure that one out....
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With