如何修复windows手机页面导航失败

本文关键字:导航 失败 手机 何修复 windows | 更新日期: 2023-09-27 18:03:56

我有一个主页。xaml,我希望从中导航到一个时间表。xaml页面,但我得到一个NavigationFailed指向:

 // Code to execute if a navigation fails
        private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
        {
            if (System.Diagnostics.Debugger.IsAttached)
            {
                // A navigation has failed; break into the debugger
                System.Diagnostics.Debugger.Break();
            }
        }
我的导航代码是:
 private void imgTimeTable_Tap(object sender, GestureEventArgs e)
        {
            NavigationService.Navigate(new Uri("/Timetable.xaml/", UriKind.Relative));
            MessageBox.Show("Images");
        }

如何修复windows手机页面导航失败

删除Uri末尾的斜杠

NavigationService.Navigate(new Uri("/Timetable.xaml", UriKind.Relative));