GestureService shouldn't handle the BackRequested from SystemNavigationManager
jp-weber opened this issue · 0 comments
jp-weber commented
Currently the BackRequested event of SystemNavigationManager is handled in the service and in tablet mode the navigation gestures do not work as intended. Since the event is not handled as true, the system back button navigates back and minimizes the app.
I would suggest to remove this from the service and treat it as best practice in the ShellPage.
private void SetupGestures()
{
_navManager.BackRequested += NavManager_BackRequested;
ShellView.BackRequested += async (s, e) => await NavigationService.GoBackAsync();
}
private async void NavManager_BackRequested(object sender, BackRequestedEventArgs e)
{
if (NavigationService.CanGoBack())
{
e.Handled = true;
await NavigationService.GoBackAsync();
}
}