Working With ConnectionSettings Task in Windows Phone


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

connection1.gif

Users can set device network settings to any of the following:

connection2.gif

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

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

connection3.gif

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

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

connection4.gif

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

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

connection5.gif

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

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

connection6.gif

In this way you can set the network setting of a device using the ConnectionSettings task. I hope this article is useful.

Thanks for reading....

Similar Articles