I want to create a solidbrush resource in my app that will change color depending on the selected theme.
Is there anyway to do this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
okay I figured it out. In StandardStyles.xaml there is a section
Here you can add the same solid brush element for each different theme.
Here I added a “Light” theme and added a solid brush called “HeaderBrush” to 2 of the themes.
To implement this brush just add it as a resource to the element. Like so…
Here I set the brush to the background color, and now it changes automatically with with theme.