之间有什么区别
(Application.Current.RootVisual as
PhoneApplicationFrame).Navigate(new Uri("/FeedBackMessageBox.xaml",
UriKind.Relative));
和
NavigationService.Navigate(new Uri("/SecondPage.xaml",
UriKind.Relative));
答案 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类相同的和属性。