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

时间:2014-05-19 10:03:24

标签: c#

我有一个MainPage.xaml,我希望从中导航到Timetable.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");
        }

1 个答案:

答案 0 :(得分:0)

删除Uri末尾的斜杠

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