Vishnu s
Vishnu s

Reputation: 261

Detect the System state in UWP

Is there any way to detect the System states (sleep ,Hibernate ,Working ,Mechanical Off ) in UWP? I have found shutdownmanager class but it's not useful.

Upvotes: 0

Views: 270

Answers (1)

Tóth Tibor
Tóth Tibor

Reputation: 1565

These states have no sense. What is Working or Mechanical Off? Also while the OS in sleep or hibernate state the application's cannot use CPU (they are not running) so you cannot respond to this states.

If you want to do your application state awareness, you need to handle the Application.Suspending and Resuming event, and also do a state restore in OnLaunched.

Upvotes: 3

Related Questions