NavigationService.Navigate与(Application.Current.RootVisual为PhoneApplicationFrame)之间的区别。在Windows Phone中导航

时间:2014-04-30 10:59:18

标签: windows-phone-8

之间有什么区别 (Application.Current.RootVisual as PhoneApplicationFrame).Navigate(new Uri("/FeedBackMessageBox.xaml", UriKind.Relative)); NavigationService.Navigate(new Uri("/SecondPage.xaml", UriKind.Relative));

在Windows Phone 8中

1 个答案:

答案 0 :(得分:4)

当您使用(Application.Current.RootVisual as PhoneApplicationFrame).Navigate(new Uri("/FeedBackMessageBox.xaml", UriKind.Relative));时,您正在考虑Frame.Navigate() method

当您使用NavigationService.Navigate(new Uri("/SecondPage.xaml", UriKind.Relative));时,您需要NavigationService property of a Page

两种方法都会像Remarks at MSDN says一样:

  

从框架内导航时,您可以使用框架上的导航方法。 Frame类包含许多与NavigationService类相同的和属性。

相关问题