防止 Windows 10 移动版锁定 [英] prevent windows 10 mobile from locking

查看:30
本文介绍了防止 Windows 10 移动版锁定的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我终于将我的 Windows 8 应用程序升级到了 Windows 10 应用程序.不幸的是,某些功能在 Windows 10 中不起作用.我正在寻找的功能之一是在我的应用程序运行时防止自动锁定屏幕.

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.

在 windows phone 8 中,我使用以下代码来防止 windows phone 自动锁定,但是,在 windows 10 中,我没有找到此功能.

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;

Windows 10 中上述选项的替代方法是什么?

What is the alternate of the above in windows 10?

谢谢!

推荐答案

您可以使用新的 DisplayRequest

使用起来非常简单:

displayRequest = new DisplayRequest();
displayRequest.RequestActive();
//Do your always on stuff
displayRequest.RequestRelease();

这篇关于防止 Windows 10 移动版锁定的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆