Prism icon indicating copy to clipboard operation
Prism copied to clipboard

NavigationService.GoBack() doesn't trigger OnGoBackRequested

Open balazs-adam opened this issue 11 years ago • 2 comments

If I perform a back navigation by pressing the hardware back button or the title bar back button the OnGoBackRequested method in App.cs gets called alright. But if I try to navigate backward by calling GoBack() on the NavigationService OnGoBackRequested doesn't get called.

Is that normal behavior? If so, then how can I handle back navigation initiated by the NavigationService on the application level?

balazs-adam avatar Nov 09 '15 21:11 balazs-adam

The OnGoBackRequested event handler is to couple the DeviceGestureService with the NavigationService. If you look at the implementation, it doesn't do much more than call NavigationService.GoBack(). So if you call GoBack yourself, you're actually using a shortcut and doing the backward navigation correctly.

bartlannoeye avatar Nov 09 '15 22:11 bartlannoeye

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar Feb 01 '20 03:02 lock[bot]