Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 58056

Back Button intercept or custom INavigation proxy

$
0
0

I need a way to intercept when the back button is clicked, and stop the current page from being popped off the stack.

An example use case is when a user is entering information on a page, and then they intentionally or accidentally hit the back button. I want to intercept it, stop it, display a "DisplayAlert", asking them "are you sure?". And if they are, then I manually Pop the page, otherwise, they are still stuck on the current page.

I can't find any way in Xamarin.Forms to do this. I looked into creating my own custom INavigation proxy (keeping the original, but setting the proxy on the current page's INavigation property), but that appears to be locked down at the moment.

Is there any ways I can currently handle this?


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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