问题
In my application their is one option to hide the app. Whenever user clicks on hide the app window as well as the app icon from task bar should be get hidden. How to achieve this in UWP?
回答1:
This feature is not supported (yet) on UWP. If you look at the UWP Skype, it always remain visible from the taskbar along with all the other apps. A UWP app cannot register by itself a global shortcut to be launched.
Minimized UWP applications are suspended by the OS when it wants/needs and will not be able to perform any job. If you hide your application you will be suspended and will not be able to perform any work. The only exception being if you request an extended execution time, your application will be allowed to run while minimized. They will still be limits but they are more battery/lock screen bounds.
If you really want to hide your app, you should just close your app window and rely on some background tasks to perform the work you might want to do when hidden/stopped.
This should be a good reading:
Windows 10 universal Windows platform (UWP) app lifecycle
Support your app with background tasks
Postpone app suspension with extended execution
来源:https://stackoverflow.com/questions/46783071/uwp-how-to-hide-the-app