How do I know what the theme is selected in the settings (light or dark)? I want to use a conditional statement such as
if (darkTheme) {..}
else {..}
You want to find your response in the official MSDN page for Theme on Windows Phone.
In the part "Determining Theme Background" that indicate :
// Determine the visibility of the dark background.
Visibility darkBackgroundVisibility =
(Visibility)Application.Current.Resources["PhoneDarkThemeVisibility"];
// Write the theme background value.
if (darkBackgroundVisibility == Visibility.Visible)
{
textBlock1.Text = "background = dark";
}
else
{
textBlock1.Text = "background = light";
}
Also, in this page, you've a part on the "theme accent color". To recover the two main colors defined by the user ( background and accent color).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With