Inder Kumar Rathore
Inder Kumar Rathore

Reputation: 39988

How to override Accent color and Default background color windows phone 8

I want to change the Accent color in my whole application to a custom color.
Currently it's coming whatever is selected in "Settings"
Also need to change the default background color for pages

Upvotes: 1

Views: 2618

Answers (1)

Inder Kumar Rathore
Inder Kumar Rathore

Reputation: 39988

You can put this in App.xml.cs constructor

//This will change the default accent color
(App.Current.Resources["PhoneAccentBrush"] as SolidColorBrush).Color = Colors.Green;

//This will change the default background color for pages
(App.Current.Resources["PhoneBackgroundBrush"] as SolidColorBrush).Color = Colors.White;

//other code


Similarly you can change the other Brush/Color specified in Theme resources for Windows Phone

Upvotes: 2

Related Questions