WP7 页面导航报错 跳到System.Diagnostics.Debugger.Break
2012-04-17 20:53
387 查看
今天写WP7 之前页面跳转真正常,页面路径也正确
但是就是报错 调试后发现总跳到
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
{
if (System.Diagnostics.Debugger.IsAttached)
{
// An unhandled exception has occurred; break into the debugger
System.Diagnostics.Debugger.Break();
}
}
后来发现是是由于 一开始 直接调试页面时
private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e)
{
// Set the root visual to allow the application to render
if (RootVisual != RootFrame)
//RootVisual = RootFrame;
RootVisual=new MainPage();
// Remove this handler since it is no longer needed
RootFrame.Navigated -= CompleteInitializePhoneApplication;
}
没有用到 RootFrame,因而NavigationService.Navigate 会产生异常
但是就是报错 调试后发现总跳到
private void Application_UnhandledException(object sender, ApplicationUnhandledExceptionEventArgs e)
{
if (System.Diagnostics.Debugger.IsAttached)
{
// An unhandled exception has occurred; break into the debugger
System.Diagnostics.Debugger.Break();
}
}
后来发现是是由于 一开始 直接调试页面时
private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e)
{
// Set the root visual to allow the application to render
if (RootVisual != RootFrame)
//RootVisual = RootFrame;
RootVisual=new MainPage();
// Remove this handler since it is no longer needed
RootFrame.Navigated -= CompleteInitializePhoneApplication;
}
没有用到 RootFrame,因而NavigationService.Navigate 会产生异常
相关文章推荐
- Win8 global::System.Diagnostics.Debugger.Break()
- UWP 程序抛出异常时总是跳到“global::System.Diagnostics.Debugger.Break();”的解决办法
- WP7页面导航
- 页面导航【WP7学习札记之七】
- WP7->界面->页面导航、切换及参数传递
- wp7 页面导航方法
- WP7中的页面导航与传值
- WP7页面导航概述
- wp7 页面导航传值和在Tombstoning之后保存状态保存状态
- wp7中如和从app.xaml.cs中直接导航到程序的某个页面
- 【转载】wp7中从墓碑化中重新激活时如何从app.xaml.cs中直接导航到程序的某个页面
- WP7.页面导航
- 学习点滴积累之System.Diagnostics.DebuggerStepThrough
- 学习点滴积累之System.Diagnostics.DebuggerStepThrough
- [翻译]WP7 QuickStart-第十篇-页面导航
- <System.Diagnostics.DebuggerStepThrough()>
- WP7 Pivot 锁定某一页面
- 键盘控制-页面网格导航-jQuery插件
- 超出指定距离固定导航(微信浏览器页面没有加载完获取控件属性办法)
- 使用System.Diagnostics.Stopwatch对比程序段运行时间