Opening Settings Screen using Launch URI in Windows Phone

As we saw in the previous post, that you can programmatically change the Lock screen of the Phone from an app which supports extension of Lock Screen defined in the Metadata file, we can also open various settings screen directly from within the app as well. To open an existing settings applet, you need to first know the URI that belongs to the Settings screen. Once you know that, you can use the following code to Launch a settings

public void OpenSettings(string settingsName)
    var op = await Windows.System.Launcher.LaunchUriAsync(new Uri(settingsName));

In the above code, when “ms-settings-lock:” is passed, it will open the Settings page that belongs to the Lock Screen settings.

When OpenSettings(“ms-settings-lock:”); is called the above screen will open with different settings options to change the Lock screen can be applied.

Similar to Lock Screens, there are also a number of other Launch URI that can help in opening various settings from an App.

1. ms-settings-airplanemode: .
2. ms-settings-bluetooth:
3. ms-settings-cellular:
4. ms-settings-emailandaccounts:
5. ms-settings-location:
6. ms-settings-power:
7. ms-settings-screenrotation:
8. ms-settings-wifi:

If you want to open a Webpage, you can pass a http link directly inside the OpenSettings screen or mailto:emailid link to the LauncUriAsync to open webpage or Email client directly from an app.

I hope this post will come handy.

Thank you for reading.

Abhishek Sur

Abhishek Sur is a Microsoft MVP since year 2011. He is an architect in the .NET platform. He has profound theoretical insight and years of hands on experience in different .NET products and languages. He leads the Microsoft User Group in Kolkata named KolkataGeeks, and regularly organizes events and seminars in various places for spreading .NET awareness. He is associated with the Microsoft Insider list on WPF and C#, and is in constant touch with product group teams. He blogs at His Book : Visual Studio 2012 and .NET 4.5 Expert Development Cookbook. Follow Abhishek at Twitter : @abhi2434

One Comment to “Opening Settings Screen using Launch URI in Windows Phone”

Comments are closed.