1

I want SystemColors.ControlBrushKey to have same color as SystemColors.HighlightBrushKey. How do I specify it in XAML? I've tried:

<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="{StaticResource SystemColors.HighlightBrushKey}"/>  

But it throws an exception: "Cannot find resource named 'SystemColors.HighlightBrushKey'. Resource names are case sensitive.". Then I've tried:

<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="{StaticResource {x:Static Member=SystemColors.HighlightBrushKey}}"/>

And the exception is: '#FF3399FF' is not a valid value for property 'Color'. After that I've tried:

<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}" Color="{x:Static Member=SystemColors.HighlightBrushKey}"/>

And I've also got an error: "'HighlightBrush' is not a valid value for property 'Color'."

So how do I specify it correctly?

4

1 回答 1

0
<SolidColorBrush x:Key="{x:Static SystemColors.ControlBrushKey}"
                 Color="{DynamicResource {x:Static SystemColors.HighlightColorKey}}"/>
于 2012-08-01T15:38:34.510 回答