简体   繁体   English

C#uwp应用程序阻止空闲模式

[英]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 ; Windows Phone 8使您的应用能够阻止手机进入锁定屏幕 :PhoneApplicationService.Current.ApplicationIdleMode = IdleDetectionMode.Disabled;

Anybody know what the equivalent is for Universal Window Platform? 有人知道Universal Window Platform的等价物是什么吗?

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. 这不能阻止用户手动锁定屏幕。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM