SplitView Bug in the Universal Windows Platform (UWP)

Last week we were trying to resolve an issue that had been raised in an application we were building for the Universal Windows Platform, where the user had to press the back button twice in order to navigate back to the previous page. Initially we thought that we must be subscribing to the hardware back button on Windows 10 Mobile, as the issue seem to only manifest itself on mobile. However, after eliminating all calls to subscribe to the back button, we were still seeing the same issue. After a bit of further testing the issue only seemed to arise if we were navigating to a new page with the pane of the SplitView visible, but not always…. Eventually we tracked it down to the scenario where the DisplayMode is set to Overlay and the pane of the SplitView is visible (ie IsPaneOpen set to true). Navigating to a new page without first either changing the DisplayMode to Inline, or closing the pane, will result in the pane staying open, and unfortunately it still keeps the event handler on the BackRequested event on the SystemNavigationManger.

SplitViewFail sample

Simple solution: make sure that you force the pane closed before navigating by setting IsPaneOpen to false (assuming the DisplayMode is set to Overlay).

Leave a comment