zoukankan      html  css  js  c++  java
  • Windows phone 未处理异常的 错误报告页面

    1.创建ErrorPage页面,增加如下代码:

            public static Exception Exception;

            // Executes when the user navigates to this page.
            protected override void OnNavigatedTo(NavigationEventArgs e)
            {
                ErrorText.Text = Exception.ToString();
            }

    2.修改App页面:

    // Code to execute on Unhandled Exceptions
            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();
                }
               e.Handled = true;

                //theException 这是一个静态成员,所以通过类名直接访问。
                ErrorPage.theException = e.ExceptionObject;
                (RootVisual as Microsoft.Phone.Controls.PhoneApplicationFrame).Source = new Uri("/ErrorPage.xaml",UriKind.Relative);
            }

  • 相关阅读:
    欧拉定理 (证明+在求逆元上的应用)
    【转】弱校的ACM奋斗史
    SDUT 2412 (单调队列 + dp)
    做SRM感想。。。
    平面图中最小割向最短路的转化
    HDU 4533
    黑书上的DP 30题
    POJ【数论/组合/博弈论】题目列表
    HDU 4534 郑厂长系列故事——新闻净化
    SRM 571
  • 原文地址:https://www.cnblogs.com/binaryworms/p/2565831.html
Copyright © 2011-2022 走看看