private void OnBackRequested(object sender = null, BackRequestedEventArgs e = null) { if (TextInputOverlay.Visibility == Visibility.Visible) { TextInputOverlay.Visibility = Visibility.Collapsed; if (e != null) { e.Handled = true; } txtInput.Text = ""; frame.Focus(FocusState.Programmatic); } else if (discoverer.HandleBackButton()) { if (e != null) { e.Handled = true; } } else { if (frame.CanGoBack) { frame.GoBack(); e.Handled = true; } } }