Is it possible to get what the current page in the navigation stack is when using Prism for xamarin?
I have noticed there is the
PageUtilities.GetCurrentPage(mainPage).
What is the usage of the above?
I was looking for something like navigationService.GetCurrentPage()
many thanks
Looking at the code for PageUtilities it looks like this method will do what you want, i.e. return the current page in the navigation stack. It looks like it handles the scenario where the current page is a MasterDetailPage, TabbedPage, CarouselPage or NavigationPage, and returns the correct page. I've tested it a little in my own app and it works as expected.
You can pass Application.Current.MainPage as the parameter to the method, like so:
var currentPage = PageUtilities.GetCurrentPage(Application.Current.MainPage);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With