locked
Windows 8 page navigation RRS feed

  • Question

  • I have to write an app store app in windows 8. I have to use the navigation events.

    1. What is the way to use the navigation events in win8 c# should I use the frame navigation events: Navigated, NavigationStopped ect or should I use page onNavigatedTo/From? What is the correct way?

    2. if I want to use the frame navigation events how and when should I add an event handler?

    I  tried at the constructor of the page but it appears the frame has not been created yet...

    Thanks

    Any sample code will be great help

    Sunday, September 30, 2012 6:36 AM

Answers

  • The page can hosted in the Frame, if one page is navigated by a Frame, the Page.Frame property can be set as the Frame. So we can use the code this.Frame.Navigate(xxx) to navigate the other pages in one page.

    Bob Bao [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by Min ZhuMember Monday, October 8, 2012 4:38 AM
    Monday, October 1, 2012 8:44 AM

All replies

  • Hi,
    I didn't get exactly what you want but I'll answer the way I understood,
    When you navigate from page to another you use 

    this.Frame.Navigate(typeof(YourPage), "Data to pass to the other page");
    And in the other page you get this data in OnNaviagtedTo event
     protected override void OnNavigatedTo(NavigationEventArgs e)
            {
                string value = e.Parameter as string;
            }
    And about onNavigatedFrom the event triggers when you navigate from this page to another(No suspended or terminated)
    Regards,



    Ibraheem Osama Mohamed | My Blog | @IbraheemOsamaMo

    (If my reply answers your question, please propose it as an answer)

    • Proposed as answer by Jie Bao Monday, October 1, 2012 8:44 AM
    Sunday, September 30, 2012 8:51 AM
  • Thnks for the reply.

    what i meant was: waht about the Frame navigation events?

    How an whanen should i use them instead of page methods you used?

    thanks

    Sunday, September 30, 2012 10:25 AM
  • The page can hosted in the Frame, if one page is navigated by a Frame, the Page.Frame property can be set as the Frame. So we can use the code this.Frame.Navigate(xxx) to navigate the other pages in one page.

    Bob Bao [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by Min ZhuMember Monday, October 8, 2012 4:38 AM
    Monday, October 1, 2012 8:44 AM