Windows Phone 7 (Mango) Tutorial - 28 - How to Detect the Current Theme? - Online Free Computer Tutorials.

'Software Development, Games Development, Mobile Development, iOS Development, Android Development, Window Phone Development. Dot Net, Window Services,WCF Services, Web Services, MVC, MySQL, SQL Server and Oracle Tutorials, Articles and their Resources

Tuesday, July 12, 2011

Windows Phone 7 (Mango) Tutorial - 28 - How to Detect the Current Theme?

Many time we need to find out which Theme we are using in Windows Phone 7. Based upon the chosen theme we may want to set our own Theme for the application. So, how to find out that?   In this post, I am going to share you the Tip. Using it you will be able to identify the current theme of your Windows Phone 7 device. Read to know more.   There are two different types of theme presently available in Windows Phone 7 called as "Dark Theme" and "Light Theme". Detecting the current theme is easy. There is a "PhoneLightThemeVisibility" resource available in the application level. If it is set to Visible, that means that you are using the Light Theme and if it is set to Collapsed, that means you are using the Dark Theme.   When you want to detect the current theme check the visibility status of the resource by retrieving it as below:   var v = (Visibility)Resources["PhoneLightThemeVisibility"]; ...

No comments:

Post a Comment