I am developing window phone 7 application. I am new to the window phone 7 application. I want to change the background color of the entire xaml page in the window phone 7 application. I have tried the following code in the constructor of the xaml page
this.Background = new SolidColorBrush(Colors.White);
But it is not working.
I have also added the attribute in the phone:PhoneApplicationPage tag as follows
<phone:PhoneApplicationPage
Background="Red"
But it is also not working. Can you please provide me any code or link or any solution through which I can resolve the above issue? If I am doing anything wrong then please guide me.
Navigate to the Properties window, and click the Background drop-down arrow, and choose Red or another color in the color picker.
Select Start > Settings > Personalization > Colors, and then choose your own color, or let Windows pull an accent color from your background.
You can set the Background property of the outermost control on the page. For a default page created in WP7 that would be a Grid named Layout.
You need to change the background of the LayoutRoot if you want to see the effect:
<Grid x:Name="LayoutRoot" Background="YellowGreen">
..
Maybe the theme does not respect the background color in the page. What you can do is add A border as a child of the page and set its background color to whatever you want.
<phone:PhoneApplicationPage>
<Border Background="Red">
...more content here...
</Border>
</phone:PhoneApplicationPage>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With