4

If I need to override a color in a brush, I would set it into App.xaml like this:

<Application.Resources> 

     ...

       <ResourceDictionary>
                <ResourceDictionary.ThemeDictionaries>
                    <ResourceDictionary x:Key="Light">
                        <SolidColorBrush x:Key="PivotHeaderForegroundUnselectedBrush" Color="#A7A9AC" />
                        <SolidColorBrush x:Key="PivotHeaderForegroundSelectedBrush" Color="Black" />
                    </ResourceDictionary>
                </ResourceDictionary.ThemeDictionaries>
            </ResourceDictionary>

         ...
</Application.Resources> 

The editor underlines <ResourceDictionary> saying: "Each dictionary entry must have an associated key".

How can solve this?

Francesco Bonizzi
  • 5,142
  • 6
  • 49
  • 88

2 Answers2

4

I solved the problem, thanks to @Alan Yao - MSFT. Maybe you have more things there?, I had something else, written into the ResourceDictionary. By making ResourceDictionary parent of everything inside Application.Resources, I solved the problem.

Francesco Bonizzi
  • 5,142
  • 6
  • 49
  • 88
0

The ResourceDictionary has to be placed inside application resources:

<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.ThemeDictionaries>
            <ResourceDictionary x:Key="Light">
                <SolidColorBrush x:Key="PivotHeaderForegroundUnselectedBrush" Color="#A7A9AC" />
                <SolidColorBrush x:Key="PivotHeaderForegroundSelectedBrush" Color="Black" />
            </ResourceDictionary>
        </ResourceDictionary.ThemeDictionaries>
    </ResourceDictionary>
</Application.Resources>
user2250152
  • 14,658
  • 4
  • 33
  • 57