0

I know how to remove the old pages from page stack.

NavigationService.RemoveBackEntry();

This will remove the last entry from the page stack.

But I want to remove all the pages form the page stack.
If I click the clear button all the page should be cleared.
Please let me know any idea to solve this.

Thanks in advance.

csharpwinphonexaml
  • 3,659
  • 10
  • 32
  • 63
  • 1
    Possible duplicate: [Clearing backstack in NavigationService](http://stackoverflow.com/questions/8241529/clearing-backstack-in-navigationservice) – Ulugbek Umirov Apr 21 '14 at 07:33

2 Answers2

0

This is how you clear your NavigationService BackEntry without getting Exceptions:

while(NavigationService.CanGoBack)
    NavigationService.RemoveBackEntry();
csharpwinphonexaml
  • 3,659
  • 10
  • 32
  • 63
0

This is the other way to remove all pages from page stack:

while( NavigationService.BackStack.Count()>0)
      {
         this.NavigationService.RemoveBackEntry();
      }
Pradeep Kesharwani
  • 1,480
  • 1
  • 12
  • 21