我正在开发一个适用于Windows 10的应用程序,其中有一个幻灯片放映,我想阻止屏幕的自动锁定(关闭)..是否可能?
答案 0 :(得分:3)
您可以使用此类执行Windows.System.Display.DisplayRequest
:
private Windows.System.Display.DisplayRequest _displayRequest;
public void ActivateDisplay()
{
//create the request instance if needed
if (_displayRequest == null)
_displayRequest = new Windows.System.Display.DisplayRequest();
//make request to put in active state
_displayRequest.RequestActive();
}
public void ReleaseDisplay()
{
//must be same instance, so quit if it doesn't exist
if (_displayRequest == null)
return;
//undo the request
_displayRequest.RequestRelease();
}
您可以在此处详细了解: https://blogs.windows.com/buildingapps/2016/05/24/how-to-prevent-screen-locks-in-your-uwp-apps
请再次确保提供您已经尝试过的内容..您是否搜索过它?...直接询问开发人员是不是很好的做法:)。