2015-10-13 101 views
0

我已經嘗試覆蓋AppBarItem和鍵盤的默認主題,但仍然強調應用程序欄項目的顏色保持默認,我使用的資源列在下面。是否可以在代碼中更改AppBarItem的背景和按下的鍵盤背景?在Windows Phone 8.1中的AppBarButton主題

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

什麼跟AppBar幫助我:http://stackoverflow.com/a/28355644/267000 – Dmitry

回答

0

你可以試試這個請:

App.xaml.cs頁:

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

更多:Overwrite Accent Color in App

+0

這有助於改變例如PhoneAccentBrush,但仍然按下的AppBarButton背景沒有改變。 – Dmitry

+0

你可以用Blend覆蓋AppBarButton的風格。它會解決你的問題:) –

+0

WinRT中存在一個錯誤,稍後我會介紹它,這使得我無法覆蓋AppBarButton主題。另外,我知道這不是AppBarButton風格,而是CommandBar主題。 – Dmitry