visual-studio-2012windows-phone-8navigationservice

Windows Phone VB "NavigationService is not declared"


Im creating a very simple Windows Phone 8.1 app in Visual Studio Express. I have added a Hyperlink control, then from that I have double click to go to the relevant VB page.

As instructed by the many tutorials out there I have added the code for the button - which should navigate it to the second page I have created.

Private Sub hyperlinkButton_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
    NavigationService.Navigate(New Uri("/SecondPage.xaml", UriKind.Relative))
End Sub

However VB keeps on giving me the error "NavigationService is not declared"

Searching the error message has given me very little joy so far.


Solution

  • In Windows Phone 8.1, code for navigation to another page are declared as,

    this.Frame.Navigate(typeof(SecondPage));