prevent windows 10 mobile from locking

时光毁灭记忆、已成空白 提交于 2019-12-24 14:08:04

问题


I have finally upgraded my windows 8 app to windows 10 app. Unfortunately some of the features are not working in windows 10. One of the features I am looking is preventing automatic lock screen while my application is running.

In windows phone 8 I am using below code to prevent auto locking of windows phone, however, in windows 10, I didn't find this feature.

PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;

What is the alternate of the above in windows 10?

Thanks!


回答1:


you might use the new DisplayRequest class

Pretty simple to use :

displayRequest = new DisplayRequest();
displayRequest.RequestActive();
//Do your always on stuff
displayRequest.RequestRelease();


来源:https://stackoverflow.com/questions/34238140/prevent-windows-10-mobile-from-locking

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!