Page navigation in windows phone 8.1 application not working.

SmashAndGrab
SmashAndGrab used Ask the Experts™
on
Hi - thanks for looking!

I am trying to do something that should be very simple but is proving difficult!
I am trying to navigate from one page to another in my windows phone 8.1 application.

I have tried 2 different methods but neither work - see screenshot.

Any ideas?

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
PawełI Design & Develop Software

Commented:
can't see the screenshot, but what you're looking for is the following

((Frame)Window.Current.Content).Navigate(typeof(TopicPage))

TopicPage is the actual class name of the view (page) you're trying to navigate to, you'll also have to include the namespace of the page

Author

Commented:
Nav Issue
PawełI Design & Develop Software

Commented:
do you have a navigation service?

try what i recommended above

((Frame)Window.Current.Content).Navigate(typeof(PreLogin))

you'll have to include some using statements

Author

Commented:
Thanks!  

Sorry - I am new to WP dev.

What do you mean do I have the naivigation service?

Which using statements do i need?

Currently I am using:

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.Storage.Pickers.Provider;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
I Design & Develop Software
Commented:
you have to add
using Windows.UI.Xaml;

and the namespace for you views folder something like

using QRReader.Views;

and that should get your navigation working.

a navigation service is a class that you would write or leverage from a framework that would encapsulate all the things required for navigation here's one that i use from template 10

https://github.com/Windows-XAML/Template10/blob/master/Template10%20(Library)/Services/NavigationService/NavigationService.cs

anyway that's probably a bit much for someone just getting stared. I recommend going through the following

https://www.youtube.com/watch?v=97u6eB4X8yU&list=PLSHRKznzO9qSyi4X4PR5mNMPnvBdZNCw6

to get started

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial