I’m creating a WP Mango app. I want to set the default page background to White, irrespective of whether Light or Dark Theme is selected, exactly like the default mail application.
I’ve followed this article and tried changing the default PhoneBackgroundBrush as:
(Application.Current.Resources["PhoneBackgroundBrush"]as SolidColorBrush).Color = Colors.White;
Any idea what I’m doing wrong or how to achieve that?
I messed with the sample, and simply don’t recommend doing this. Do the extra work, create your own resources, and apply them yourself.
This method doesn’t show updates in the designer, which will make your UI development difficult.
It also doesn’t even work properly — the background doesn’t change. If you read the comments on the blog post, there are other issues with it working with other controls.
So, just do it normally – in your App.xaml (you could also do it in a seperate ResourceDictionary)
then, on a page
You could even do this quickly on all your pages using Find & Replace, provided that you never changed the name ‘LayoutRoot’. If you find
you can replace with