[英]Toast notification navigate WinRT
尋找信息,但我找不到。 告訴我,當單擊常規通知時如何導航到所需頁面。 有興趣在關閉和打開應用程序的同時進行操作。
ps我的意思是ScheduledToastNotification
如果使用的是UWP,則需要在App.xaml.cs中的protected override void OnActivated(IActivatedEventArgs args)
方法中處理激活。 如果args.Kind == ActivationKind.ToastNotification
則args
的類型為ToastNotificationActivatedEventArgs
。
看到:
由於@Squidward,我找到了您問題的答案。 從上面的文章中,我轉到了https://msdn.microsoft.com/ru-ru/library/windows/apps/xaml/hh868212.aspx
在我的代碼中,我在Arguments數據中添加了以下內容和OnLanched字段。 現在,我可以制定計划了!
ToastTemplateType _toastTemplate = ToastTemplateType.ToastText02;
XmlDocument _toastXml = ToastNotificationManager.GetTemplateContent(_toastTemplate);
//this set argument for OnLaunched
IXmlNode toastNode = _toastXml.SelectSingleNode("/toast");
((XmlElement)toastNode).SetAttribute("launch", "111111");
//---
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.