Search code examples
c#xamlwindows-phonewindows-phone-8.1

Windows Phone 8.1 Page Navigation


I'm still new with the Windows Phone development. So now I'm going to develop the Windwos Phone 8.1. I really no idea what's the problem with the page navigation. I wrote the code like this

private void hbGo_Click(object sender, RoutedEventArgs e)
{
    this.Frame.Navigate(typeof(SecondPage));
}

but it shows me the error (This page does not contain a definition for "Frame" and no extension method "Frame" accepting the first arguments) even i put like the code of bottom also the same...

Frame.Navigate(typeof(SecondPage));

Solution

  • The Navigation depends on the kind of your project:

    If it is Windows Phone 8.1 Silverlight then you should use NavigationService.Navigate() method:

    Applies to: Windows Phone 8 and Windows Phone Silverlight 8.1 | Windows Phone OS 7.1

    If you are targeting Windows Phone RunTime then you should use Frame.Navigate method():

    Minimum supported phone Windows Phone 8.1 [Windows Runtime apps only]