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

How to Bind a Command to the Popped Event Handler of the NavigationPage

$
0
0

Hi,

I would like the ability to prompt the user for logout confirmation when pressing the Back button at the top of my Xamarin.Forms Android page.

How might I go about this?

I have the following in my MainActivity.cs :-

[SetPage(new NavigationPage(new ViewModelLocator().LoginView));](SetPage(new NavigationPage(new ViewModelLocator().LoginView));)

I have tried defining a NavigationPage in XAML however I get a Null Reference exception.

I think I would like to bind my PerformBack Command from my LoginViewModel to the Popped event handler of the NavigationPage however I am not entirely sure how I might achieve this.

Thanks

Paul Diston


Viewing all articles
Browse latest Browse all 58056

Trending Articles



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