Below is a sample code snippet demonstrating how launch the Airplane mode Settings app via the URI Scheme and LaunchUriAsync method in Windows Phone using C#.
Launch the Airplane mode Settings App using URI Scheme in Windows Phone 8
using AbundantCodeWP8.Resources;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Net.NetworkInformation;
using Microsoft.Phone.Shell;
using Microsoft.Phone.Tasks;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Windows.Devices.Geolocation;
using Windows.System;
namespace AbundantCodeWP8
{
public partial class MainPage : PhoneApplicationPage
{
public MainPage()
{
InitializeComponent();
}
async private void Button_Click_1(object sender, RoutedEventArgs e)
{
// How to open the Airplanemode Settings App using URI Scheme in Windows Phone 8
await Launcher.LaunchUriAsync(new Uri("ms-settings-airplanemode:"));
}
}
}
Leave a Reply