问题
I made a game and it needs it own exit button.
I was not able to use the CoreApplication.Exit() static method here. There is no CoreApplication class in Windows.ApplicationModel.Core namespace in Javascript Applications.
回答1:
CoreApplication.Exit is provided only for testing purposes. If you want to exit app you can close current window
window.close();
Important note (from MSDN): If you use window.close, it appears as a crash to the user and is logged as a crash in the developer’s telemetry data on the Windows Store dashboard.
If you want to proactively "crash" app - you should use the terminateApp method.
来源:https://stackoverflow.com/questions/37848841/how-to-exit-or-close-an-javascript-uwp-app-programmatically-windows-10