<PackageReference Include="Microsoft.Win32.SystemEvents" Version="10.0.0-preview.1.25080.5" />

PowerModes

public enum PowerModes
Defines identifiers for power mode events reported by the operating system.
Resume = 1

The operating system is about to resume from a suspended state.

A power mode status notification event has been raised by the operating system. This might indicate a weak or charging battery, a transition between AC power and battery, or another change in the status of the system power supply.

Suspend = 3

The operating system is about to be suspended.