delete
delete

Reputation:

How can I manage different screens on a Windows Phone 7 application?

For example, I want a button to take me to a settings page, and then back to the main screen. Just as an example for me to understand the workflow. Any guidance?

Upvotes: 0

Views: 226

Answers (3)

Daniel Greitens
Daniel Greitens

Reputation: 11

You must take care of certification requirements! Look at this tutorial: http://www.yourwindowsphone7.com/tutorials/navigation-in-windows-phone-7-apps.html

Upvotes: 1

John Vert
John Vert

Reputation: 86

Dr. Herbie's method works great.

Another option is to implement INavigate on your PhoneApplicationPage. Then use a HyperlinkButton. If you have a lot of buttons and don't want to write a bunch of click handlers, this can be more convenient.

Your implementation of INavigate.Navigate just uses the page's NavigationService like this:

    public bool Navigate(Uri source)
    {
        NavigationService.Navigate(source);
        return true;
    }

Upvotes: 1

Dr Herbie
Dr Herbie

Reputation: 3940

I use the NavigationService to navigate to the new page, where the Uri has a path relative to the project's base directory.

private void OptionsMenuItem_Click(object sender, EventArgs e)
{
    // Navigate to the new page
    NavigationService.Navigate(new Uri("/Views/OptionsView.xaml", UriKind.Relative));
}

The back button on the phone will take the user back to the previous page automatically, or you could code you own return button using the NavigationService again.

Upvotes: 5

Related Questions