我想在下载完成时显示 toast 通知。但是它不起作用。为什么不起作用?
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);
}