Edit: This is under windows 7.1 RC. (This code did work for 7.0)
Lets say we open the application up in the dark theme. A line of code to detect this would be as fol
This is a known issue. The theme is applied to your application when it starts, so only then you are able to correctly detect whether the light or dark setting is used. Otherwise, you are stuck with the old theme until the application restarts.
That being said, it is unlikely that the user will reproduce this behavior. If he switched from your app to phone settings, chances are he is not going back via the back button.