Combobox change highlight winRT color (metro application)

I want to change the color of combobox in winRT (Windows Store app).

It looks like this. And I would like to replace the purple color.

A weird color

I tried:

<ComboBox>
    <ComboBox.Resources>
        <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}">Red</SolidColorBrush>
    </ComboBox.Resources>
    <ComboBoxItem>One</ComboBoxItem>
    <ComboBoxItem>Two</ComboBoxItem>
</ComboBox>

This does not work because x: Static no longer exists in the Windows storage application, and if I use StaticResource, the resource "System.HighlightBrushKey" does not exist.

thank

+5
source share
1 answer

It looks like the names of the embedded resources have been changed, so now you need to redefine these brushes:

<SolidColorBrush x:Key="ComboBoxItemSelectedBackgroundThemeBrush" Color="#FF4617B4" />
<SolidColorBrush x:Key="ComboBoxItemSelectedPointerOverBackgroundThemeBrush" Color="#FF5F37BE" />

Here you can find the full brush list ComboBoxItem: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/jj709911.aspx

+6
source

All Articles