Before the Windows Anniversary update you could not do that. The application theme was always the one you set in the App.xaml
file:
<Application
...
RequestedTheme="Dark">
</Application>
Now with the new Anniversary Update, you can remove this line from the App.xaml
file, which will make the app honor the user's system settings.
The RequestedTheme
enumeration has actually three values - Dark
, Light
and Default
. Default
is the value that reflects the system settings, Dark
and Light
force the theme.
If you want to actually detect the current theme in code when App's RequestedTheme
is Default
, you will probably need to check the some color resource like SystemAltHighColor
for its value, because that will give you an idea of what theme is currently set.