Reputation: 4317
I try to create a own design for my app. One of the main things is, that I want to replace the accent color with my own color.
Now I can overwrite the brush with this:
<Color x:Key="AppAccentColor">#ff6b53</Color>
<SolidColorBrush x:Key="PhoneAccentBrush" Color="{StaticResource AppAccentColor}"/>
Now if I assign the PhoneAccentBrush somewhere it displays the correct color. But if I click on a TextBox the Border is still the Color of the Color set in the system settings.
I tried to overwrite these colors as well for example with this:
<SolidColorBrush x:Key="PhoneTextBoxEditBorderBrush"
Color="{StaticResource AppAccentColor}" />
But this seems to have no effect.
Also I tried to create a new style and copied the one I found in the 8.1\Design[Theme]\System.Windows.xaml folder on the System. But here he doesn't find different Resources who are in the ThemeResources.xaml in the same folder. As soon as I import this as well he can't build anymore. What am I doing wrong ? o.O
Thanks NPadrutt
Upvotes: 0
Views: 599
Reputation: 1892
In Windows Phone 8.1 Runtime apps there is another way to override theme colors. You can do it in App.xaml file. Here's example of changing TextBox
highlighted border color:
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default">
<SolidColorBrush x:Key="TextSelectionHighlightColorThemeBrush" Color="Magenta" />
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>
</Application.Resources>
And your TextBox
will look like this:
Check the full list of brushes you can override this way: https://msdn.microsoft.com/en-us/library/windows/apps/dn518235.aspx
As you can see in my solution, I used it for Default style. But you can have different options for Light and Dark style.
Upvotes: 1