Reputation: 666
Recently I have started exploring VS2015 and I went through the basic tutorial of how to create a hello world using c++ in VS2015(https://msdn.microsoft.com/en-us/library/windows/apps/hh974580.aspx).
After copying and building the exact same thing, the background color that I got was light instead of dark like the example shown in the link. I know ThemeResource is responsible for the background color and there are light and dark color scheme.How do you use dark instead of default(light)?
Upvotes: 3
Views: 917
Reputation: 3232
In the App.xaml
<Application ... RequestedTheme="Dark"
But take care that depending on the version of Windows Preview and the Phone it can be applied or not. In the 10074 it works in previous it does not.
IMPROVEMENT (when you want to change the theme in Runtime):
Suppose you want to change the theme on runtime, if you want to change the Application Current RequestedTheme you cannot but you can do the following:
MainPage.Current.RequestedTheme = ElementTheme.Light;
Apart the Popups won't change the theme as well(Take care about your Window Layout)
Popup.RequestedTheme = ((Window.Current.Content as Frame).Content as Page).RequestedTheme;
Upvotes: 4