mert
mert

Reputation: 1000

Why doesn't my toast notification code work?

I want to show toast notification when downloading is completed.But it doesn't work.Why doesn't work ?

if (download.Progress.Status == BackgroundTransferStatus.Completed)
        {
            XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastImageAndText04);

            XmlNodeList stringElements = toastXml.GetElementsByTagName("text");
            stringElements[0].AppendChild(toastXml.CreateTextNode("Hello toast"));

            ToastNotification toast = new ToastNotification(toastXml);

            ToastNotificationManager.CreateToastNotifier(CoreApplication.Id).Show(toast);
        }

Upvotes: 0

Views: 537

Answers (1)

ZombieSheep
ZombieSheep

Reputation: 29953

Have you made sure your app is toast-capable in the app manifest?

Upvotes: 2

Related Questions