Search code examples
windows-phone-8.1resourceswinrt-xamlwinrt-component

AppBarButton theme in Windows Phone 8.1


I've tried to override default themes for AppBarItem and Keyboard, but still accent colors for application bar items remain default, resources that I've used are listed below. Is it possible to change in code the background of AppBarItem and the background of phone keyboard in pressed stated?

"PhoneAccentBrush",
"ButtonPressedBackgroundThemeBrush",
"ProgressBarIndeterminateForegroundThemeBrush",
"ProgressBarForegroundThemeBrush",
"ToggleSwitchCurtainBackgroundThemeBrush",
"SliderTrackDecreaseBackgroundThemeBrush",
"CheckBoxPressedBackgroundThemeBrush",
"AppBarBackgroundThemeBrush",
"AppBarBorderThemeBrush",
"AppBarItemBackgroundThemeBrush",
"AppBarItemPointerOverBackgroundThemeBrush"
"AppBarItemPressedBackgroundThemeBrush"

Solution

  • Can you try this please :

    in App.xaml.cs page :

    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.ThemeDictionaries>
                <ResourceDictionary x:Key="Default">
                    <SolidColorBrush x:Key="TheRecourceKeyHere" Color="Magenta" />
                </ResourceDictionary>
            </ResourceDictionary.ThemeDictionaries>
        </ResourceDictionary>
    </Application.Resources>
    

    For more : Overwrite Accent Color in App