xaml - 导航到新页面失败 : Automatically returns to previous page on Windows Phone 8

标签 xaml windows-phone-8 windows-phone-8-emulator navigationservice

我创建了一个 Pivot 应用程序,启动主页并使用按钮导航到一个新的空白页面。

private void Forgot_Password_Click(object sender, RoutedEventArgs e)
{
    NavigationService.Navigate(new Uri("/ForgotPasswordPage.xaml", UriKind.Relative));
}

显示新页面,但过了一会儿,它终止并返回上一页。我还收到以下错误:

The thread 0x990 has exited with code 259 (0x103).

有人经历过类似的行为吗?

但是,如果我直接启动此页面(ForgotPasswordPage)(而不是主页),它会正常启动。

更新:

我注意到这种情况发生在我从带有透视控件的页面导航的任何页面上。这和问题有什么联系吗?

更新#2:

我尝试了以下流程: 假设我有以下页面:

  • 主页
  • 主页(这是带有枢轴的页面)
  • 登录页面

我启动 MainPage,然后使用应用程序栏上的操作导航到主页。到目前为止一切都很好。然后使用按钮导航到 LoginPage,这是一个简单的空白页面。一段时间后,该页面终止,我自动返回主页。

然后我尝试从 MainPage 启动 LoginPage。登录页面正常启动,但几秒钟后它终止,我返回到我从未导航到的主页!!!!

这有助于理解出了什么问题吗?

更新#3

我从一开始就设置了整个项目,然后开始添加前一个项目中的代码。我发现这种行为是由于我拥有的 DispatchTimer 产生的,我从未停止过它。修复了它,现在问题解决了。谢谢大家的帮助。

提前致谢!

最佳答案

问题似乎是 DispatchTimer 持续运行 用户在问题中更新。

UPDATED #3

I setup the whole project from the beginning and then started adding the code from the previous project. I found that this behaviour was generated due a DispatchTimer I had, which I had never stopped. Fixed it and now the problem is solved.

此特定问题的解决方案是仔细管理应用程序内任何长时间运行的操作。

关于xaml - 导航到新页面失败 : Automatically returns to previous page on Windows Phone 8,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23838408/

相关文章:

wpf - 如何在后台 WPF 进程中呈现 <image>?

c# - 如何从图像控制 Windows 8 应用程序将图像保存到文件夹

c# - 如何在文本区域的文本末尾显示省略号 (...)?

visual-studio - Windows 手机模拟器无法正常工作(visual studio 更新 3)?

windows-phone-8-emulator - Windows Phone 模拟器未运行

c# - 使用 MVVMCross 在 WPF 中捕获 OnExit 事件

c# - 为什么在 DataGridTextcolumn 中找不到 ObservableCollection 中实际类的属性,但父类属性是?

c# - 将子项添加到 XDocument 中的根 XElement

windows-phone-8 - 事件处理程序过载时的异常

windows-phone-8.1 - 意外错误 : -2147483638 while deploying windows8. 1 应用程序给我的设备