Search code examples
c#.netuwpwindows-phone

How to get Power saving mode in UWP Apps?


I am trying to get the power saving mode in UWP apps and I find the PowerManager class in Windows​.Phone​.System​.Power.dll and I am not able to reference it in UWP apps.. is there any other way to check the power saver mode is enabled? and my target device is windows 10 tablet as of now.. if there's way to reference Windows​.Phone​.System​.Power.dll in the Universal Windows project please let me know.


Solution

  • For a UWP app you should use Windows.System.Power.PowerManager (i.e. not from the phone namespace, which is for WP 8.1 apps): https://learn.microsoft.com/en-us/uwp/api/windows.system.power.powermanager

    Thanks - Stefan Wick

    Windows Developer Platform