Disabling Display timeout in Universal Windows App

March 14, 2015 • 2 min read

There are many scenarios in an App where you’d want the User’s device display to stay On; For showing directions, playing videos, presentations, reading, to name a few.

In Universal Windows Apps, this can be done with DisplayRequest:

using Windows.System.Display;

DisplayRequest displayRequest = new DisplayRequest();
displayRequest.RequestActive();

This will make sure that the device’s display stays On even without any User interaction while the App presents relevant info on screen. The App can also enable Display timeout when it no longer needs the display to stay On.

To Re-enable the Display timeout simply make the following call:

displayRequest.RequestRelease();

Always re-enable the Display timeout when it’s not required. Also, keep in mind that the Display Requests are cumulative. For every Active requests, you will have to request Releases to enable Display timeout. You can enable and disable Display timeout any & as many times you want in the App.

I hope this Mini article helps you in your App development. Happy coding!

Blog, RSS Feed