c# - 防止平板电脑在应用程序运行时休眠

标签 c# windows-8 tablet power-saving

我正在尝试编写一个 Windows 8 平板电脑应用程序,它通常可以在接收输入之间花费几分钟。

问题是,如果我不一直触摸屏幕,节电程序就会启动,屏幕会自动变黑,这会扰乱应用程序的用户。

我的应用程序是否可以通过某种方式阻止节能器激活,或者至少延长节能器激活所需的时间。

最佳答案

你应该使用 DisplayRequest class以防止屏幕关闭。

Apps that show video or run for extended periods without user input can request that the display remain on by calling DisplayRequest::RequestActive. When a display request is activated, the device's display remains on while the app is visible. When the user moves the app out of the foreground, the system deactivates the app's display requests and reactivates them when the app returns to the foreground.

关于c# - 防止平板电脑在应用程序运行时休眠,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13202146/

相关文章:

c# - 在通用类中同时具有 "class"和 "new()"约束是否毫无意义?

c# - 在代码中设置 Entity Framework 的凭据,不使用 Integrated Security 并且仅将用户 ID 存储在配置文件中

.net - 我在哪里/如何下载(和安装)适用于 Windows 8、64 位的 Microsoft.Jet.OLEDB.4.0?

c# - 分组项目页 : View jumps back to start when navigating back from detailpage

c# - C# windows 应用程序可以在基于 windows 8 的平板电脑上运行吗?

c# - Xml 序列化在简单类上因 NullReferenceException 而失败

windows-phone-8 - 我的系统上未安装 Windows Phone 8.1 模拟器

html - 带有单选按钮的跨浏览器(平板电脑)错误

cordova - 如何将 PhoneGap 应用程序部署到 Android 平板电脑市场?

c# - 如何在 C# 中启用第二个监视器?