是否可以在 Windows 10 uwp 中防止锁屏?
Is it possible to prevent lock screen in Windows 10 uwp?
我正在为 Windows 10 开发一个有幻灯片放映的应用程序,我想防止屏幕自动锁定(关闭)..这可能吗?
你可以用这个 class 来做那个 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
请再次确保提供您尝试过的内容..您搜索过吗?..作为开发人员直接询问不是一个好习惯:).
我正在为 Windows 10 开发一个有幻灯片放映的应用程序,我想防止屏幕自动锁定(关闭)..这可能吗?
你可以用这个 class 来做那个 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
请再次确保提供您尝试过的内容..您搜索过吗?..作为开发人员直接询问不是一个好习惯:).