How to Detect Windows Phone Theme by Code
In Windows Phone app development it is important to detect Windows Phone theme selected by the smartphone user by programmatically in Windows Phone 8 app code. Your Windows Phone 8 app must be compatible with Windows Phone light theme and Windows Phone dark theme. Actually this is related with the graphics you used in your app. If you design your app considering only the dark theme, some icons, buttons or images may not be seen when the user selects Windows Phone Light theme from settings app.
So it is important to detect Windows Phone 8 theme (light or dark) set as active theme color in app code. According to the theme set as active, you can choose the corresponding images and graphic objects in your Windows Phone app pages.
Below app developers can find a few lines of C-Sharp code to test if Windows Phone Light theme is selected and set as active theme on target Windows Phone 8 device.
And here is an other method in VB.NET code programmers can use in their Windows Phone app development projects to identify active Windows Phone theme color. The first two function codes return true if selected theme is selected in their theme colors. And the last code block calls these functions to detect active Windows Phone 8 theme.