C# 通知中的ShellToast导航

C# 通知中的ShellToast导航,c#,windows-phone-8,navigation,notifications,scheduled-tasks,C#,Windows Phone 8,Navigation,Notifications,Scheduled Tasks,我在我的应用程序ScheduledAgent.cs中使用ShellToast,当我想单击ShellToast的通知显示时,我想导航到不同的第二页,但当我尝试时,什么也没有发生 protected override void OnInvoke(ScheduledTask task) { var toast = new ShellToast { Title = "KWTtest", Content = toastMessage }; toa

我在我的应用程序ScheduledAgent.cs中使用ShellToast,当我想单击ShellToast的通知显示时,我想导航到不同的第二页,但当我尝试时,什么也没有发生

protected override void OnInvoke(ScheduledTask task)
{
   var toast = new ShellToast
   {
        Title = "KWTtest",
        Content = toastMessage
    };
    toast.NavigationUri = new Uri("/View/SettingsPage.xaml", 
    UriKind.RelativeOrAbsolute);
    toast.Show();
    NotifyComplete();
    }
}

这是正确的代码。它在我的应用程序中起作用。 你收到祝酒通知了吗? 如果单击通知,应用程序是否未完全打开?
或者在单击通知后打开应用程序,但从主页开始?

确切地说,应用程序是在主页上打开的,我还尝试使用新的Uri(“/View/MainPage.xaml?NavigatedFrom=Toast notification”,UriKind.Absolute),并在OnNavigatedTo中选中主页上的查询字符串以选择字符串NavigatedFrom;if(NavigationContext.QueryString.TryGetValue(“NavigatedFrom”,out NavigatedFrom)){…}但是QueryString似乎是空的,因为您的附加操作问题中显示的示例代码是需要的。您将收到一个toast通知,单击该通知将在属性toast.NavigationUri指定的页面上自动运行您的应用程序。尝试在app.xaml.cs中的调试器中设置断点,例如,
async private void InitializeLicensing()
和逐步前进。也许应用程序中的某个地方更改了导航框架。这可以在app.xaml.cs中的一个方法中进行。或者在导航到的
中的MainPage.xaml.cs等。您帮助我了解了很多信息,在您的应用程序中,它是有效的,我不知道为什么,但它现在可以工作了,我只是添加了#define DEBUG_AGENT当然我希望在删除它时它会再次工作