0
我想在下載完成時顯示吐司通知。但它不起作用。爲什麼不起作用?爲什麼我的吐司通知碼不起作用?
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);
}
*什麼*不起作用?是否有錯誤訊息?如果是,那麼異常發生在哪一行?您是否調試過該方法並檢查了XML的值? – Adam
沒有任何錯誤消息。我調試並檢查了值。我沒有發現任何錯誤。 – mert