
I have 2 theme's registered. dark & light. Switching between those works great and everything adapts to the dark or light mood except my Label which should be darkgreen for light theme and lightgreen for dark theme. How can I do this?
I have 2 theme's registered. dark & light. Switching between those works great and everything adapts to the dark or light mood except my Label which should be darkgreen for light theme and lightgreen for dark theme. How can I do this?
Hello,
In our Themes section of samples in the Sample Browser, please see the Theme Override QuickStart. That sample shows how you can register XAML ResourceDictionaries on a per-theme basis, so you can put Styles or other Brush overrides in there. Then they will be pulled in by our ThemeManager as theme changes occur.
In your case you could define a Style for Label and have one variation set for your Light theme and another variation set for your Dark theme.
Amazing how elegant and simple it works. Kudos.
Please log in to a validated account to post comments.