C# - Raise event on PowerStatus change
问题 I've created an application that need to be in a safe state and so I want to follow the power status of the computer in background. If the battery level (if any) is low or critical, I wouldn't allow the user to continue using the application and quit all properly. First of all, I'm astonished that no such event exists in order to detect the change. You need always to check the PowerStatus manually. So, I've created a wrapper around it, something like this : using System; using System.Windows