I need to have some generic colors in my application, which are based on the system colors, which change based on the active theme. So I believe I need some IValueConverters that each return a brush when given a system color brush.
But where do I put the logic? As I see it I might have 2 options.
Option 1) place SolidColorBrush(es) in the themed resource dictionary, which bind to some system colors and converts them into new Brush(es). This I have tried and it seems to work, but how do I reference these new SolidColorBrush(es) from code-behind.
Option 2) create a class similar to SystemColors class. I don't quite know how I just go about doing this. What is the relation between the SystemResourceKey and the Brush in the SystemColors class? How are they connected?
Best Regards, Jesper
1. e.g.
2. You cannot use
SystemResourceKeys
, they are internal, but can probably reuse the keys from the SystemColors class to build your dictionary, it does not really matter what you use, a key can be any object, this question might be of interest.