Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# uwp application prevent idle mode

Windows Phone 8 had the ability for your app to prevent the phone from going to the lock screen: PhoneApplicationService.Current.ApplicationIdleMode = IdleDetectionMode.Disabled ;

Anybody know what the equivalent is for Universal Window Platform?

like image 483
John Kurtz Avatar asked Feb 21 '26 14:02

John Kurtz


1 Answers

You can use this:

var displayRequest = new Windows.System.Display.DisplayRequest();
displayRequest.RequestActive();

But be aware of the fact that you are just requesting the screen to stay active. This can not prevent the user from locking the screen by himself manually.

like image 62
Robin-Manuel Thiel Avatar answered Feb 23 '26 03:02

Robin-Manuel Thiel