jon86

Hi.

I have a simple XBAP application and am struggling to set the background color. The XBAP has a 990 by 530 Canvas colored red. When the XBAP displays in Internet Explorer, the 'Page' background is white, even though I have set it to be black.

How would I set the background color so the XBAP shows a red canvas on a black background

Thanks.
Jon

Code:

<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="PersonalSite.Main"
Title="Main"
Width="990"
Height="530"
Foreground="#FF000000" Background="#FF000000">
<Canvas Background="#FFB71313" />
</Page>


Re: Windows Presentation Foundation (WPF) How do I set the background color in an XBAP application?

Hua Wang - MSFT

Why do you need to set Width and Height on the Page Get rid of the absolute size. Set it on Canvas if you need to. The page should size to its container so it will paint the whole background.





Re: Windows Presentation Foundation (WPF) How do I set the background color in an XBAP application?

jon86

Oops! I just noticed that.

Thanks for your time.