Paul DeCarlo
Paul DeCarlo

Reputation: 416

Disable Application from sleeping in Windows 8 Metro

I am working on an app which displays videos and am running into an issue where the machine goes to sleep after hitting the sleep time limit while a video is playing. Is there a way to disable this behavior in a Windows 8 Metro application?

Upvotes: 2

Views: 1669

Answers (1)

ZombieSheep
ZombieSheep

Reputation: 29953

You should use the DisplayRequest class, specifically DisplayRequest.RequestActive for this purpose. You must also remember to call DisplayRequest.RequestRelease once you are done to allow the display to sleep, for example, if you are not actively playing the movie, or in a menu screen, etc.

Upvotes: 4

Related Questions