Quantcast
Viewing latest article 7
Browse Latest Browse All 79144

How to call previous page from current page using NavigationStack in Xamarin Forms?

why i am not able to call previous page from current displaying page using NavigationStack?
I have a code

    List<Page> li = Navigation.NavigationStack.ToList();
    Page last = li.ElementAt(li.Count - 2);  //This line give me the page to go back
    Navigation.PushAsync(last);   //This line gives me an error of 'Page must not already have a parent.'

and if i try to add

List<Page> li = Navigation.NavigationStack.ToList();
Page last = li.ElementAt(li.Count - 1);
 Navigation.RemovePage(last);

This above code throws me to main page but not to previous page
Please help


Viewing latest article 7
Browse Latest Browse All 79144

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>