How to set Airplane mode in Windows Phone using C# ?

Airplane mode is a feature in Windows Phone that lets the user to easily turn off the cellular , Wi-Fi , Bluetooth etc .

If you want to access turn on / off the Airplane mode from your Windows Phone App , then you can use the Launcher “ConnectionSettingsTask” to achieve it .

How to set Airplane mode in Windows Phone using C# ?

Just set the ConnectionSettingsType of the ConnectionSettingsTask to AirplaneMode and call the show method .

This will launch the AirplaneMode settings form where you can turn on/off the AirplaneMode .

To use the ConnectionSettingsTask Launcher , use the namespace Microsoft.Phone.Tasks;

private void button1_Click(object sender, RoutedEventArgs e)

{

SetAirplaneMode();

}

private void SetAirplaneMode()

{

ConnectionSettingsTask connectionSettingsTask = new ConnectionSettingsTask();

connectionSettingsTask.ConnectionSettingsType = ConnectionSettingsType.AirplaneMode;

connectionSettingsTask.Show();

}

httpv://www.youtube.com/embed/bkrPavrLxQQ

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you’ll learn about the Win32 Error “0x000019E5 – ERROR_COULD_NOT_RESIZE_LOG” that you get when debugging system erors in...
In this post, you’ll learn about the error “CO_E_DBERROR 0x8004E02B” that is returned when working with COM based APIs or...
In this post, you’ll learn about the Win32 Error “0x000019D0 – ERROR_LOG_BLOCK_VERSION” that you get when debugging system erors in...