• <bdo id='b3y56'></bdo><ul id='b3y56'></ul>
    1. <small id='b3y56'></small><noframes id='b3y56'>

        <legend id='b3y56'><style id='b3y56'><dir id='b3y56'><q id='b3y56'></q></dir></style></legend>
        <tfoot id='b3y56'></tfoot>
        <i id='b3y56'><tr id='b3y56'><dt id='b3y56'><q id='b3y56'><span id='b3y56'><b id='b3y56'><form id='b3y56'><ins id='b3y56'></ins><ul id='b3y56'></ul><sub id='b3y56'></sub></form><legend id='b3y56'></legend><bdo id='b3y56'><pre id='b3y56'><center id='b3y56'></center></pre></bdo></b><th id='b3y56'></th></span></q></dt></tr></i><div id='b3y56'><tfoot id='b3y56'></tfoot><dl id='b3y56'><fieldset id='b3y56'></fieldset></dl></div>

        Windows Phone 8 页面之间的导航问题

        时间:2023-08-28

        1. <small id='xl8q5'></small><noframes id='xl8q5'>

            <tfoot id='xl8q5'></tfoot>
            <i id='xl8q5'><tr id='xl8q5'><dt id='xl8q5'><q id='xl8q5'><span id='xl8q5'><b id='xl8q5'><form id='xl8q5'><ins id='xl8q5'></ins><ul id='xl8q5'></ul><sub id='xl8q5'></sub></form><legend id='xl8q5'></legend><bdo id='xl8q5'><pre id='xl8q5'><center id='xl8q5'></center></pre></bdo></b><th id='xl8q5'></th></span></q></dt></tr></i><div id='xl8q5'><tfoot id='xl8q5'></tfoot><dl id='xl8q5'><fieldset id='xl8q5'></fieldset></dl></div>

              <bdo id='xl8q5'></bdo><ul id='xl8q5'></ul>
                    <tbody id='xl8q5'></tbody>
                  <legend id='xl8q5'><style id='xl8q5'><dir id='xl8q5'><q id='xl8q5'></q></dir></style></legend>
                1. 本文介绍了Windows Phone 8 页面之间的导航问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我有一个带有登录过程的 Windows 手机应用程序,该登录过程访问外部 API.登录按钮的控制器最初运行了一些立即导航到仪表板页面的代码:

                  I have a windows phone app with a login process, that login process accesses an external API. The controller for the login button originally ran some code that instantly navigated to the dashboard page:

                      private void LogInButton_Click(object sender, RoutedEventArgs e)
                      {
                          ...
                  
                          App.RootFrame.Navigate(new Uri("/Interface.xaml", UriKind.RelativeOrAbsolute));
                      }
                  

                  这很好用!

                  后来,我认为最好实现与 api 的实际连接,检查用户详细信息是否正确,然后重定向到仪表板.为简洁起见,我已经删除了 api 部分,但是假设这个函数作为 Action 委托 在各处被传递,然后在它的正确位置(控制器)被调用...

                  Later on, I thought it best to implement the actual connection to the api, check if the user details are correct and on that, redirect to the dashboard. for brevity I have taken out the api parts, but let's say this function gets passed all over the place as an Action delegate before being called in it's rightful place, the controller..

                      ...
                      // This method is also located in the controller class, but it is called by another class
                      public void LoadDashboard( DataUpdateState data )
                      {
                          //data.AsyncResponse
                          App.RootFrame.Navigate(new Uri("/Interface.xaml", UriKind.RelativeOrAbsolute));
                      }
                  

                  问题是,导航方法现在不再起作用,它会在 RootFrame_NavigationFailed 上触发调试中断.

                  The thing is, the navigation method now no longer works, it fires a debug break on RootFrame_NavigationFailed.

                  我在这里不明白什么?

                  有没有办法找出它在 App 类中加载导航失败方法的原因

                  Is there a way of finding out just why it loaded the navigation failed method in the App class

                  推荐答案

                  您可以在导航失败事件的 NavigationFailedEventArgs 中获取更多详细信息(在 Exception 参数中).

                  You can get more detail in the NavigationFailedEventArgs of the navigation failed event (in the Exception parameter).

                  最可能的原因是您尝试从非 ui 线程调用 Navigate.如果是这种情况,只需使用调度程序在 ui 线程上调度它:

                  The most probable cause is that you are try to call Navigate from a non ui thread. If that the case just use a dispatcher to dispatch it on the ui thread:

                  Deployment.Current.Dispatcher.BeginInvoke(() =>
                              {
                          App.RootFrame.Navigate(new Uri("/Interface.xaml", UriKind.RelativeOrAbsolute));
                  
                              });
                  

                  这篇关于Windows Phone 8 页面之间的导航问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何计算转弯方向 下一篇:WPF中类似访问的数据导航?

                  相关文章

                  最新文章

                    1. <legend id='f7LuP'><style id='f7LuP'><dir id='f7LuP'><q id='f7LuP'></q></dir></style></legend>
                      • <bdo id='f7LuP'></bdo><ul id='f7LuP'></ul>
                    2. <tfoot id='f7LuP'></tfoot>
                      <i id='f7LuP'><tr id='f7LuP'><dt id='f7LuP'><q id='f7LuP'><span id='f7LuP'><b id='f7LuP'><form id='f7LuP'><ins id='f7LuP'></ins><ul id='f7LuP'></ul><sub id='f7LuP'></sub></form><legend id='f7LuP'></legend><bdo id='f7LuP'><pre id='f7LuP'><center id='f7LuP'></center></pre></bdo></b><th id='f7LuP'></th></span></q></dt></tr></i><div id='f7LuP'><tfoot id='f7LuP'></tfoot><dl id='f7LuP'><fieldset id='f7LuP'></fieldset></dl></div>

                    3. <small id='f7LuP'></small><noframes id='f7LuP'>