本文介绍了ToastNotification启动事件不指向特定页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

按照Toast通知触发吐司,但不会指向特定页面。
   ToastTemplateType toastType = ToastTemplateType.ToastText02;

            XmlDocument的toastXml = ToastNotificationManager.GetTemplateContent(toastType);

Following toast notification triggers the toast but is not directing to specific page
   ToastTemplateType toastType = ToastTemplateType.ToastText02;
            XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(toastType);

            XmlNodeList中toastTextElement = toastXml.GetElementsByTagName(QUOT;文本");

            toastTextElement [0] .AppendChild(toastXml.CreateTextNode(" Quotes Area")));

            toastTextElement [1] .AppendChild(toastXml.CreateTextNode(todayQuote));

            XmlNodeList toastTextElement = toastXml.GetElementsByTagName("text");
            toastTextElement[0].AppendChild(toastXml.CreateTextNode("Quotes Area"));
            toastTextElement[1].AppendChild(toastXml.CreateTextNode(todayQuote));

            // var toastNavigationUriString ="#/ TodayQuote.xaml?quoteID = 1" ;;

            IXmlNode toastNode = toastXml.SelectSingleNode(" toast");

            ((的XmlElement)toastNode).SetAttribute(QUOT;持续时间" ;,英寸长");

            ((的XmlElement)toastNode).SetAttribute(QUOT;启动"," {\" type\":\" toast\",\" param1\":\" ; 11 \"}");

            //var toastNavigationUriString = "#/TodayQuote.xaml?quoteID=1";
            IXmlNode toastNode = toastXml.SelectSingleNode("/toast");
            ((XmlElement)toastNode).SetAttribute("duration", "long");
            ((XmlElement)toastNode).SetAttribute("launch", "{\"type\":\"toast\",\"param1\":\"11\"}");



在Windows 8.1 XAML项目中,我在OnLaunched事件中有以下代码


In Windows 8.1 XAML project, I have following code in OnLaunched event

           (!string.IsNullOrWhiteSpace(e.Arguments))如果

           if (!string.IsNullOrWhiteSpace(e.Arguments))

             &NBSP ;  {

               


                      rootFrame.Navigate(typeof运算(TodayQuote),e.Arguments);

                {
               
                     rootFrame.Navigate(typeof(TodayQuote), e.Arguments);

            &NBSP ;   }
               否则b $ b                {

                    rootFrame.Navigate(typeof(HubPage),e.Arguments);

                 }

                }
                else
                {
                    rootFrame.Navigate(typeof(HubPage), e.Arguments);
                }

我正在运行模拟器,因此生成了Toast通知,点击Toast不会出现"TodayQuote.XAML"。页。

I am running to simulator so Toast notification is generated, clicking on Toast is not going to "TodayQuote.XAML" page.

任何帮助都将不胜感激!!

Any help would be greatly appreciated !!

推荐答案


这篇关于ToastNotification启动事件不指向特定页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 08:10