How to make UWP app to suspend and resume state

2019-03-03 13:46发布

I am able to suspend and resume the UWP application using visual studio Life cycle events. But when I tried with User's machine I am unable to get the suspend and resume state of the application.

I tried using resource monitor to suspend and resume the process , but it is not hitting "Onsuspend" event, while on resuming it is not hitting "OnResume" event.

Is there any other way to hit the OnResume event in the application?

2条回答
Lonely孤独者°
2楼-- · 2019-03-03 14:17

When running outside of the debugger on a desktop machine you can just minimize the app to the taskbar to trigger the OnSuspending event. Then restore it back from the taskbar to trigger the OnResuming event.

查看更多
放荡不羁爱自由
3楼-- · 2019-03-03 14:30

We can make the Application to go suspend and resume state in tablet mode.

Change the OS to tablet mode(we can change it in action center). In the tablet mode only fore ground application will be in running state. All other UWP applications in the background will be in "Suspended state". When we make those application to fore ground it will come from "Suspend state" to "Resume state".

查看更多
登录 后发表回答