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?
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
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;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With