Reputation: 261
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
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