Search code examples
c#xamlwindows-store-appswindows-8.1

Changing a single theme color in Windows Store 8.1 app


I am aware that there are only 3 standard themes available on Windows Store 8.1 app. I'm OK with that. But I would like to change a single color or brush from the selected theme (for example I want to change ButtonBackgroundThemeBrush in the Light theme to solid Red) for my application. Anyone know how to achieve that?

I found these questions on SO:

Make own windows 8 app theme

How do I mix Light and Dark themes in a C#/XAML Windows Store (Metro UI) App?

Create a theme in Windows 8.1

but I could not find any clear answer.


Solution

  • Ok, I found the way, just insert into App.xaml the following code:

    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.ThemeDictionaries>
                <ResourceDictionary x:Key="Light">
                    <SolidColorBrush x:Key="ButtonBackgroundThemeBrush" Color="Red" />
                </ResourceDictionary>
            </ResourceDictionary.ThemeDictionaries>
        </ResourceDictionary>
    </Application.Resources>