如何在 Universal phone 应用程序中保持屏幕亮起?

How to keep the screen on in Universal phone app?

在Windows通用之前,如果我想防止屏幕关闭,我可以使用:

PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;

那个 API 现在不见了,我找不到类似的东西。现在有人可以帮我找到正确的方法吗?

看看 DisplayRequest class:https://msdn.microsoft.com/en-us/library/windows/apps/br241816.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-2。它适用于

show video or run for extended periods without user input

所以它应该是一个解决方案。