NavigationService.navigate null reference exception

后端 未结 3 827
名媛妹妹
名媛妹妹 2020-12-06 23:48

I\'m learning WP coding and I have problem that I can\'t solve :/

try
 {
    NavigationService.Navigate(new Uri(\"/edit.xaml\", UriKind.Relative));
 }
 catch         


        
3条回答
  •  半阙折子戏
    2020-12-07 00:09

    This solve the problem:

    (Application.Current.RootVisual as PhoneApplicationFrame).Navigate(new Uri("/edit.xaml", UriKind.Relative));
    

提交回复
热议问题