How to launch the Rotation Settings page in WP8 GDR3?


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.

 


If you have come this far, it means that you liked what you are reading. Why not reach little more and connect with me directly on Twitter, Facebook, Google+ and LinkedIn. I would love to hear your thoughts and opinions on my articles directly. Also, don't forget to share your views and/or feedback in the comment section below.

1 comments

  1. Hello kunal, this is Babu Mandan(facebook)
    how we can identify is screen rotation is on/off by programming.
    and also for 'battery saver'

    ReplyDelete

 
© 2008-2016 Kunal-Chowdhury.com - Microsoft Technology Blog for developers and consumers | Designed by Kunal Chowdhury
Back to top