How does windows 8 manage stack of Pages in Frame?

后端 未结 4 967
感动是毒
感动是毒 2021-01-16 22:52

How does Windows 8 manage a stack of Pages in a Frame?

And how can I clear the whole stack programmatically, as in I need to \'pop\' all pages in a stack and return

4条回答
  •  孤街浪徒
    2021-01-16 23:08

    Try implementing your own Frame class, something similar to this:

    http://blogs.microsoft.co.il/blogs/eshaham/archive/2012/04/30/fixing-frame-navigation-in-metro-style-apps.aspx

    Then you could write a RemoveLastEntry method that basically does this:

    void RemoveLastEntry()
    {
        if (_navigationStack.Count > 0)
        {
            _navigationStack.Pop();
        }
    }
    

    and call this method a certain number of times.

    Or you could call GoHome method which takes you back to the first screen (that would be clearing the whole stack except the first item).

    I hope this'll take you in the right direction!

提交回复
热议问题