In my project on one page there is a form to add products.
if user doesn't save the details and pressed back button, at that time I want to display the action sheet having Discard, Save, Cancel options.
I'm unable to get the back button pressed event.
I'm working in Xamarin studio and used cross platform with xamarin form
I've already tried OnBackButtonPressed event but it doesn't get call
protected override bool OnBackButtonPressed()
{
Device.BeginInvokeOnMainThread(async() => {
var result = await DisplayActionSheet("Action","Cancel",null,"Discard","Save");
//if (result) await this.Navigation.PopAsync(); // or anything else
});
return base.OnBackButtonPressed();
}