ConnectionSettings Task allows user to set and adjust device network settings. ConnectionSettings task is defined in Microsoft.Phone.Tasks namespace as below,
User can set device network setting to any of the following
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();
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();
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();
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();
In this way you can set the network setting of device using ConnectionSettings task. I hope this post is useful. Thanks for reading
Follow @debug_mode
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.