我有一个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");
}
答案 0 :(得分:0)
删除Uri末尾的斜杠
NavigationService.Navigate(new Uri("/Timetable.xaml", UriKind.Relative));