I will tell you how to exit the application in UWP by the code.
We can call some static method to help us to exit the application.
The first method is as this code:
And the other one is
If you are making the WPF application that you can use this code to exit the application.
If you find any problems, please contact me.
本文会经常更新，请阅读原文： https://lindexi.gitee.io/lindexi/post/How-to-use-code-to-exit-the-application-in-UWP.html ，以避免陈旧错误知识的误导，同时有更好的阅读体验。