Accessing Windows Phone Settings from code

DSCF3741.jpg

I’ve discovered that one way to make sure that I remember how to do something is to drop it into the blog. That way I can go find it when I forget. This time it is the code that you use to open up the connection settings dialog page in Windows Phone 8.

ConnectionSettingsTask connectionSettingsTask = 
                                  new ConnectionSettingsTask();
connectionSettingsTask.ConnectionSettingsType = 
                                  ConnectionSettingsType.Bluetooth;
connectionSettingsTask.Show();

This will do the business. You need to include the Tasks namespace:

using Microsoft.Phone.Tasks;

There are options that you can use to open up the WiFi, Cellular and Airplane modes.

Whenever I open the Airplane mode I always want the phone to say

“Surely you can’t be serious?”
”I am serious. And don’t call me Shirley”