Reputation: 507
I try to navigate to a different page. I'm using visual studio express 2012. But i've read that on win-phone 8.1 we need to use System.Windows.Controls.Frame. The problem is that i dont find Frame in my namespace, I just have primitive inside. I would like to know if there is a way to update this package to have it. Thanks.
Upvotes: 0
Views: 417
Reputation: 3157
You shlould create Windows Phone Universal application instead of Silverlight. When creating new project in Visual Studio you shloud choose: Store Apps-> Windows Phone Apps -> There will be two types of projects: Silverlight (in parentheses there will be Windows Phone Silverlight) and Universal (in parentheses there will be Windows Phone) so you should choose second option.
After creating new project you can navigate form one Page to another using:
Framne.Navigate...
Hope I helped.
Upvotes: 0
Reputation: 21889
Windows.UI.Xaml.Controls.Frame is for Windows Phone 8.1 Runtime apps. NavigationService.Navigate is for Windows Phone 8.0 and 8.1 Silverlight apps.
If you're using Visual Studio 2012 then you have a Windows Phone 8.0 Silverlight app. You need Visual Studio 2013 to write a Windows Phone 8.1 app.
Silverlight apps use NavigationService.Navigate for page navigation. See How to perform page navigation on Windows Phone 8
Your Windows Phone 8.0 app will run on Windows Phone 8.1 without modification. It just won't have access to the new Windows Phone 8.1 functionality.
When you get Visual Studio 2013 (I'd suggest the Community Edition) you'll be able to upgrade it to a Windows Phone Silverlight 8.1 app. This will use the same NavigationService you use in a Silverlight 8.0 app.
The other option with Visual Studio 2013 is to write a Windows Phone Runtime app, which can be a Universal app sharing code with a Windows Store app (to run on Windows). Windows Runtime apps use the Windows.UI.Xaml namespace instead of System.Windows. Instead of NavigationService they use Windows.UI.Xaml.Controls.Frame. See Quickstart: Navigating between pages (XAML)
Upvotes: 1