问题
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