ConnectionSettings Task allows user to set and adjust device network settings. ConnectionSettings task is defined in Microsoft.Phone.Tasks namespace as below,

image

User can set device network setting to any of the following

image

If you want to set Network connection setting to WiFi, you can set it as below,


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

image

If you want to set Network connection setting to Bluetooth, you can set it as below,


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

image

If you want to set Network connection setting to Cellular, you can set it as below,


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

image

If you want to set Network connection setting to Airplane mode, you can set it as below,


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


image

In this way you can set the network setting of device using ConnectionSettings task. I hope this post is useful. Thanks for reading

Advertisements

4 thoughts on “How to Use the ConnectionSettings Task for Windows Phone

  1. Pingback: WindowsDevNews.com
  2. Is it possible to program this as a switch from a tile without using the windows gui. So only the event, en not the show()?
    What i want is to touch a tile without opening another screen, and that the touch changes, for example, the wifi setting to On. Another touch will set the wifi setting to Off. Like a switch.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s