QuickBytes: Hacking up the color of a WinRT ProgressBar


WinRT never ceases to throw a curveball at the you. I was trying to change the default ‘Violet’ color of the ProgressBar and ProgressRing to something more ‘in tune’ with my app’s style, but the only ‘violet’ color visible was the Foreground property, but changing it did nothing to change the color of the ‘running dots’.

After ‘ducking’ around I found a Brush called ProgressBarIndeterminateForegroundThemeBrush. There are two ways to override it.

1. Create a resource with the same name and assign a different color. You can do it in your App.xaml or in the XAML of the screen you need it updated in as follows:

<Application.Resources>
<SolidColorBrush
x:Key=”ProgressBarIndeterminateForegroundThemeBrush”
Color=”#FF2EADE8″/>
</Application.Resources>

2. Update the color at runtime in code. I found this article that might come in handy.

Hope this helps someone, it’s a note for me anyway!

Advertisements
Tagged ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: