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 true;
}