C# 在windows phone 8.1应用程序中单击本地通知时,应用程序未打开?

C# 在windows phone 8.1应用程序中单击本地通知时,应用程序未打开?,c#,windows-phone-8,windows-phone-8.1,toast,C#,Windows Phone 8,Windows Phone 8.1,Toast,我开发了一个windows phone应用程序。在此计划的本地通知中。 发生的是通知来了,但每当我单击通知应用程序未打开时,它就会返回。 下面是我的代码: string textLine1 = "Sample Toast App"; string textLine2 = "This is a sample message."; string contentString = "<toast duration=\"lo

我开发了一个windows phone应用程序。在此计划的本地通知中。 发生的是通知来了,但每当我单击通知应用程序未打开时,它就会返回。

下面是我的代码:

string textLine1 = "Sample Toast App";
            string textLine2 = "This is a sample message.";
            string contentString =
              "<toast duration=\"long\">\n" +
                "<visual>\n" +
                  "<binding template=\"ToastText02\">\n" +
                    "<text id=\"1\">" + textLine1 + "</text>\n" +
                    "<text id=\"2\">" + textLine2 + "</text>\n" +
                  "</binding>\n" +
                "</visual>\n" +
              "</toast>\n";



XmlDocument content = new Windows.Data.Xml.Dom.XmlDocument();
content.LoadXml(contentString);

DateTime EventDate = new DateTime(2016, 02, 11, 12, 45, 00);

ToastNotifier toastNotifier =ToastNotificationManager.CreateToastNotifier();
var scheduledToast = new ScheduledToastNotification(content, EventDate);
toastNotifier.AddToSchedule(scheduledToast);

我该怎么办。请帮助我。

您必须将“
launch
”属性设置为应用程序登录页。下面是示例

<toast launch="/Views/HomeView.xaml?toast=test">
    <visual>
        <binding template="ToastText01">
            <text id="1">Hello World!</text>
        </binding>
    </visual>
</toast>

你好,世界!

您必须将“
launch
”属性设置为应用程序登录页。下面是示例

<toast launch="/Views/HomeView.xaml?toast=test">
    <visual>
        <binding template="ToastText01">
            <text id="1">Hello World!</text>
        </binding>
    </visual>
</toast>

你好,世界!

实际上我没有在我的开发项目中放置任何图标。因此没有显示。请查看我上面的代码。在这段代码中,每当我输入DateTime.Now.AddSeconds(30)时,它就会正常工作,应用程序就会打开。但是DateTime EventDate=新的日期时间(2016,02,11,12,45,00);我很高兴此应用程序未打开。两者都相同。但声明不同。比较两个日期时间值。可能你必须指定DateTimeKind实际上我没有在我的开发项目中放置任何图标。所以没有显示。请查看我上面的代码。在这段代码中,每当我输入DateTime.Now.AddSeconds(30)时,它就会正常工作,应用程序就会打开。但是DateTime EventDate=新的日期时间(2016,02,11,12,45,00);我很高兴此应用程序未打开。两者都相同。但声明不同。比较两个日期时间值。可能您必须指定DateTimeKindCheck您的有效负载字符串,所有的反斜杠和双斜杠!检查你的有效载荷字符串,所有的反斜杠和双斜杠!