Closed YourFutureHusband closed 1 year ago
The SDK does have this ability, but we didn't end up documenting it yet. However, it is supported.
Off the XboxGameBarWidget object there is a
event Windows.Foundation.TypedEventHandler<XboxGameBarWidget, XboxGameBarWidgetCloseRequestedEventArgs> CloseRequested;
runtimeclass XboxGameBarWidgetCloseRequestedEventArgs
{
Windows.Foundation.Deferral GetDeferral();
Boolean Handled{ get; set; };
}
If you subscribe to CloseRequested, it will call your handler before closing the widget. If you take a deferral (to perform async work), we'll wait for that deferral before checking that handled property. If you set Handled to true, we'll cancel our internal close and rely on your code to "do the right thing". If you return false, we'll proceed with the close.
Closing as there is a solution to the issue
I would like to implement a feature inside my application that detects when a user closes the game bar widget window (using the "X" button on the upper right), showing a simple prompt, similar to what other non UWP apps do:
Windows Creators update (version 1703) added systemnavigationmanagerpreview exposing a closerequested event. Unfortunately this event does not trigger.
Is there a different solution?