My app is fully theme aware. When my app is deactivated and user changes theme from dark to light (let's say) and returns to my application, the theme is not refreshed. Even though the phone theme is light my app still remains dark.
I did some tryings but they report the same values. I declared a variable called isDarkThemeSelected, saved the value in deactivated event, changed the theme, and entered back into my application. But when the activated event is raised the variable value still remain the same.
Do you have any solution?
Add this code to your main page constructor:
var v = (Visibility)Resources["PhoneLightThemeVisibility"];
Debug.WriteLine("Using " + (v == Visibility.Visible ? "light" : "dark") + " theme");
(It detects the current theme and writes to the Output window which one it is.)
Then start the app, look at the Output in Visual Studio, close the app, change the theme, start the app and look again. If it says different things the first time and the second time then your app isn't as theme-aware as you think.
Edit: It seems like this doesn't always work due to a Mango bug. The theme remains the same when you navigate back to the app after changing the theme. It is only when the user restarts the app from the app list that the new theme is applied.
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