コード例 #1
0
        private void pb_BatteryStatusChanged(object sender, BatteryStatusEventArgs e)
        {
            int    id  = BatteryStatusChangedEventId + e.BatteryPercentageRemaining;
            string msg = "The remaining battery capacity has changed: "
                         + e.BatteryPercentageRemaining + "%";

            WriteLogEntry(msg, id);
        }
コード例 #2
0
 public void OnBatteryStatusChanged(object sender, BatteryStatusEventArgs e)
 {
     BatteryStatus = e.BatteryStatus;
     PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("BatteryStatus"));
 }