Hey,
is there a way in Xamarin.Forms to press the back button from code? I tried to call OnBackButtonPressed and SendBackButtonPressed but this does not work. The OnBackButtonPressed Event is called but the back action does not perform.
Call OnBackButtonPressed:
if (_currentQuestionnaireGroup != null)
await RefreshDataAsync();
else
{
App.QuestionnaireOverviewPage.IsDirty = true;
this.OnBackButtonPressed();
}
Event:
protected override bool OnBackButtonPressed()
{
if (_questionnaireHandler != null)
App.QuestionnaireOverviewPage.IsDirty = true;
return base.OnBackButtonPressed();
return true; //tried this also
}
If i press the hardware back button on android the OnBackButtonPressed is also called but this performs the real back action.
Thanks.