Skip to content

Instantly share code, notes, and snippets.

@JanDeDobbeleer
Created November 10, 2014 12:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JanDeDobbeleer/aaf073407c3ea555ace4 to your computer and use it in GitHub Desktop.
Save JanDeDobbeleer/aaf073407c3ea555ace4 to your computer and use it in GitHub Desktop.
Override default colors in a Windows Phone RT app.
#region custom methods
private void SetupCustomColors()
{
SetColor("ProgressBarIndeterminateForegroundThemeBrush", ((SolidColorBrush)Current.Resources["VikingRed"]).Color);
//SetColor("PivotHeaderForegroundUnselectedBrush", ((SolidColorBrush)Current.Resources["VikingGrey"]).Color);
SetColor("PivotHeaderForegroundSelectedBrush", Colors.White);
}
private void SetColor(string resource, Color color)
{
if (!Resources.ContainsKey(resource))
return;
var brush = Resources[resource] as SolidColorBrush;
if (brush != null)
brush.Color = color;
}
#endregion
@jadore801120
Copy link

Hi, could you teach me how to use this code to override the theme color?
I copy your code to my app.xaml, but it did not work on my windows phone runtime.
Thanks for every help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment