How to launch the Rotation Settings page in WP8 GDR3?

If you are a WPDev, you might want to programmatically launch the Rotation Settings page from your Windows Phone 8 app or game. In this post, we are going to discuss on this today. - Article by Kunal Chowdhury on


Windows Phone 8 GDR 3 is already there for the developers to try out the new features that are coming in this update 3. Among them, one is orientation lock. If you already installed WP8 GDR3, you might have already seen the Rotation Settings page.

 

If you are a WPDev, you might want to add an option in your app to launch this settings page. In this post, we are going to discuss how to do this programmatically.

 

Windows Phone 8 GDR 3 - Screen Rotation Settings pageWindows Phone 8 GDR 3 - Screen Rotation Settings page

 

Rotation Settings page is only available in Windows Phone 8 GDR 3 or higher. You can invoke this page programmatically by passing proper Uri to the Launcher.LaunchUriAsync(…) method. Here is the code to launch the Rotation Settings page from code:

 

Launcher.LaunchUriAsync(new Uri("ms-settings-screenrotation:"));

 

The above code will only work in Windows Phone 8 OS version 8.0.10492 or higher. Make sure that, you check the OS version first before executing the code. Here is a post that will describe “How to programmatically detect whether WP8 GDR3 is installed?”. The complete code is available below, which you can use in your Windows Phone 8 apps and/or games:

 

if (Environment.OSVersion.Version >= new Version(8, 0, 10492))
{
        Launcher.LaunchUriAsync(new Uri("ms-settings-screenrotation:"));
}

 

If you did not yet download the latest Windows Phone 8 Update 3, you can check this post to know “How to download Windows Phone 8 GDR 3?”. I hope, this post was useful. Stay tuned for more articles and tips. Connect with me on Twitter and Facebook page to get the latest updates.

 





9to6linux.com | Covering latest news, articles, Tips and Tricks on Linux platform


Latest Tech News