AppWindow and system Back button

Ivanich 306 Reputation points
2021-06-04T12:05:43.263+00:00

What is recommended way to handle system Back button click with new AppWindow APIs?

Let's say, we have main window and secondary AppWindow opened side-by-side on a tablet. User pressed hardware or software Back button and SystemNavigationManager fires BackRequested event. But secondary AppWindow shares CoreWindow with main window and it is not clear which of them should handle this event. Unlike old Window, AppWindow does not have events to track whether it is active or not.

Universal Windows Platform (UWP)
{count} votes

Accepted answer
  1. Ivanich 306 Reputation points
    2021-06-09T11:48:38.847+00:00

    It seems like AppWindow cannot handle system back button events, moreover, SystemNavigationManager.BackRequested does not fire when current active window is AppWindow. Instead of processing this event, AppWindow just hides, so only way to close it when user pressed system back button is handling visibility changes. AppWindow has Changed event and IsVisible property. WindowingEnvironment.Kind in tablet mode is set to Tiled.

    0 comments No comments

0 additional answers

Sort by: Most helpful