Windows Phone 7 : Check the power status

You might need to check if your phone is connected to power or running in battery.

 //Check Power Status
var power = Microsoft.Phone.Info.DeviceStatus.PowerSource;
textBlock1.Text = power.ToString();

Namoskar!!!