Win10 uwp screen always on
We need to keep the screen bright when playing a video. We can use DisplayRequest because the code is simple and I will write it directly.
Recently, I am not promising to break UWP with others. I have seen many other countries, but I still don't know about it in China. But now I am going to use linux C ++. UWP will not give up in a year or two.
If we do this, the screen will not be turned off. If we put it, it will first become grayed out, and then it will become dark. If we need to play a video, we will not press the screen, the screen must always be on.
The following code can be used on our play screen so that the screen will not be turned off, but the screen will not be normally played by an application. If there is anything else to turn off the screen, the screen will not always turn on.
Now we can see that the screen is always on UWP. I have to wait for a long time for the app to be transferred to the background. I don't know if my pc can make the app go on the background mobile phone.
Public event Action on_paly; private DisplayRequest displayRequest; protected override void OnNavigatedFrom (NavigationEventArgs e) {base. onNavigatedFrom (e); displayRequest = new DisplayRequest (); displayRequest. requestRelease (); on_paly + = () => {displayRequest. requestActive ();};}