How to Detect if Battery Saver is Currently Enabled on Windows Phone 8

To detect when Battery Saver is enabled you must check the PowerManager.PowerSavingModeEnabled property. Because this property is only available for devices running Windows Phone 8 Update 3, you must access this property via reflection after checking the device OS version. The following example shows you how to detect if Battery Saver is currently enabled.

Get a verified Dream Spark account.

Students can get verified and download free softwares through their dreamspark accounts. Here’s how you can get yourself verified.

There are various ways to get verified.

  • Using a college/school email id: A email id issued by your school/college with .edu domain
  • School account
  • Using a International Student Identity card
  • Using a verification code: Ask your college’s MSPs to provide you a verification code

If you don’t have any of these then supply a college document. Acceptable documentation is dated student ID, current progress report, current dated class schedule, or acceptance letter to the school of higher education.

Here’s how you could fill it up.


Dictionary in C#

Dictionary<TKey, TValue> provide fast lookups, based on keys, to get values. With them, we use keys and values of any type, including int and string. Dictionary is used with different elements. We specify its key type and its value type (string, int).

Define a Dictionary

We specify its key type and its value type (string, int).

Add elements to a Dictionary

Here’s how to add elements to a Dictionary.

Read and update existing values

To read a value use the following statement.

To update an existing value simply use the following.

Check if a key exists in a Dictionary

This sees if a given string is present in a Dictionary.

Iterate through a Dictionary

Here we loop over KeyValuePairs in a Dictionary. With collections like Dictionary, we must always know the value types. With each KeyValuePair, there is a Key member and Value member.

Remove elements from a Dictionary

Here’s how you can remove elements from a Dictionary.

Count elements in a Dictionary

This computes the total number of keys in a Dictionary. This is simpler than accessing the Keys property, or looping over the Dictionary to count it.

Clear all elements from a Dictionary

We can erase all pairs with the Clear method.

Check if a value exists in a Dictionary

This method lacks the constant-time look up speed of ContainsKey. It instead searches the entire collection.

Get all keys of a Dictionary

Here we use the Keys property. We then look through each key and look up the values.