Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GestureService shouldn't handle the BackRequested from SystemNavigationManager #1730

Open
jp-weber opened this issue Jun 20, 2020 · 0 comments

Comments

@jp-weber
Copy link
Member

jp-weber commented Jun 20, 2020

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.

https://github.com/Windows-XAML/Template10/blob/master/Source/Template10.Core/Services/Gesture/GestureService.cs#L149

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();
            }
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant