I want to navigate conditionally to previous page on back press event. But on back press, OnDisappearing method is called and its going to the previous page in the stack. Below is my code in OnDisappearing. To be precise, i want to stop the navigation going to previous page on back press conditionally. Is it possible?
protected override void OnDisappearing ()
{
if (_homeFolder.Id != _parentFolder.Id) {
//Remain in this page
} else {
//Go to previous page
base.OnDisappearing ();
}
}