tags:

views:

38

answers:

2

I currently have a silverlight app designed mainly in expression blend, using a border with a drop shadow effect encircling a rounded rectangle control. When I embed this application into a page, there is a white background around the object. I want to make this background either transparent so the page background color (defined in css) shows through, or somehow change the silverlight app to have the blue background instead of the white.

A screenshot of my current problem is at: http://img694.imageshack.us/img694/8132/problemz.jpg

Here is the code I am using to embed the app into the page:

<object width="750px" height="480px" data="data:application/x-silverlight-2," type="application/x-silverlight-2">
    <param name="source" value="/ClientBin/Debug/my.xap" />
    <param name="windowless" value="true" />
</object> 

I have tried messing around with the windowless parameter but to no success. Thanks for any help

+1  A: 

Solution: added

<param name="background" value="transparent" />
Andrew
A: 

"I want to make this background either transparent so the page background color (defined in css) shows through"

No, you don't.

Short Answer: Just change the background of the Root Element of the Silverlight page to light blue or whatever it is.

Longer Answer: It's possible to interweave browser content with Silverlight content using WindowsLess=True.
http://msdn.microsoft.com/en-us/library/cc838156(VS.95).aspx

Long Answer: WindowsLess=True sucks from a performance standpoint and has many other limitations, so don't use it.
Limitations of Windowless mode for Silverlight

Let's do browser plugin overview 101:
1) An object tag is initialized that belong to plugin "Foo"
2) The browser loads plugin "Foo"
3) The browser delegates rendering Rectangle(X1, Y1, X2, Y2) on the page to Foo Plugin.

The only way to interweave content from the browser with the the plugin is to use a mixed mode rendering. Which essentially works like so:
1) The browser renders Rect(X1, Y1, X2, Y2) and sends that to Foo plugin.
2) Foo plugin interleaves the result of step (1) in every single frame in renders.

Step (1) doesn't have to happen when you're in non-interweaving mode. Which is also the default.

So, by adding interweaving, you're adding more steps to each frame render in Silverlight. Which is massively bad for performance reasons.

Bottom Line: What you're asking for is interweaving content, which in Silverlight is set by a WindowsLess=True param, but it causes performance issues and other limitations. Since your scenario is simple enough, I'd just set the Silverlight background to the appropriate colour.

JustinAngel