Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable screen from autolocking on Windows Phone 7

I need to prevent the screen from automatically locking itself if the user dont interact with the device for a while.

Is it possible to request some kind of lock to keep the screen on while running my application?

like image 621
jorgenfb Avatar asked Dec 02 '10 20:12

jorgenfb


2 Answers

Yes, you can do this by disabling UserIdleDetection.

Samples and more background info here.

PhoneApplicationService.UserIdleDetectionMode Property (Microsoft.Phone.Shell)

Idle Detection for Windows Phone

like image 157
Mick N Avatar answered Nov 03 '22 14:11

Mick N


I did not found example code in MSDN, so I decided to put it up here because I was also looking for an answer to this problem:

using Microsoft.Phone.Shell;

PhoneApplicationService phoneAppService = PhoneApplicationService.Current;
phoneAppService.UserIdleDetectionMode = IdleDetectionMode.Disabled;
like image 21
Markus Rudel Avatar answered Nov 03 '22 14:11

Markus Rudel