Coming from Windows Phone 8
I have never thought there will be a lot of changes done to the Windows Phone 8.1
code. Basically I'm just wondering how to do page navigation just like how you would do it on Windows Phone 8
. To do that you should add:
NavigationService.Navigate(new Uri("/SecondPage.xaml", UriKind.Relative));
but that code doesn't work for Windows Phone 8.1
.
Can someone please help me with this? If possible provide any links or documentation on all the new Windows Phone 8.1
methods.
In Windows Phone 8.1, Page Navigation method is like this:
It means that you will navagate to 'SecondPage', and pass 'param' (a class based on object).
If you needn't to pass any parameters, You can use this:
You can find the documentation for this MSDN link
To send multiple parameters: Its quite late to answer but might help someone. You can create a custom class, set your parameters in it and send its object as a parameter to your target page.
For example. Your custom class:
And then on the target page you can retrieve in OnNavigatedTo function like this:
Hope it helps.
In case you want to go back you can use:
If you want to go back on the click of back button, you need to override the hardwarebutton event:
Make sure to set e.Handled to true.