문제

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.

도움이 되었습니까?

해결책

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

while(NavigationService.CanGoBack)
    NavigationService.RemoveBackEntry();

다른 팁

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

while( NavigationService.BackStack.Count()>0)
      {
         this.NavigationService.RemoveBackEntry();
      }
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top