Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
218 views
in Technique[技术] by (71.8m points)

c# - 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));
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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]


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...