How to remove all except bottom page from pageStack?
I have application with few dialogs and subpages, which i push to pageStack when i need them.
Now i have coveractions which also pushes dialog or page to pageStack when invoked.
If user has minimized application with subpage or dialog open, the coveraction will push invoked page on top of these pages, which is the problem.
I solved this to check if pageStack.depth>1
, i will replace topmost page with pageStack.Replace()
.
This however works only if i have only one subpage or dialog open.
I tried to repeat pageStack.pop
until pageDepth==1
, but the it refuses to open new page as the transition animation is active.
If i use pageStack.pop(pageStack.currentPage, pageStackAction.Immediate)
nothing happens.
if i use pageStack.clear
, also the "FirstPage" is removed from stack.
Or should i get the component-id of the "FirstPage" and use pageStack.popAttached(firsPageId)
?