c# - How to go back multiple Pages? -


in universal app, want use frame navigate through app. have breadcrumb, per designs. don't know how handle things when user wants go multiple pages.

my breadcrumb items simple strings display using xaml listview. find index of breadcrumb user clicked on , try go many times.

i tried using loop:

private void breadcrumb_item_tapped(object sender, tappedroutedeventargs e) {     var breadcrumb = ((sender grid).datacontext string);      for(int = 1; < breadcrumbs.count - breadcrumbs.indexof(breadcrumb); i++)     {         frame.goback();     } } 

but frame.goback() doesn't work, i'm guessing because going fast after goback() call before. don't want use sleep method, because should instant.

what can go multiple pages?

i suggest using frame.backstack.removeat(frame.backstackdepth-1)

this way remove entries stack without navigating. use loop decide when should stop removing , execute final frame.goback()


Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -