如果在Silverlight中添加了控件阴影效果,就需要设置UserControl的背景色透明以便防止到页面中
具体设置如下
HTML页面中做如下设置
<object data="data:application/x-silverlight," type="application/x-silverlight-2" width="20%" height="20%">
<param name="background" value="Transparent" />
<param name="Windowless" value="true" />
ASP.NET页面中的话做如下设置
<asp:Silverlight ID="Silverlight1" runat="server" Height="50px"
Source="~/SilverlightTest.xap" Width="200px" Windowless="true" PluginBackground="Transparent">
</asp:Silverlight>
<param name="Windowless" value="true" />
此设置为true则允许Silverlight在无窗口模式下运行,只有该设置为true时背景颜色才会使用Alpha数值,所以要透明效果此设置必须为true。