Monday, June 11, 2007

Silverlight Transparent Control Creation

Step1: Open page Default.aspx.js

Step2: Goto the function "createSilverlight"

Step3: set the isWindowless value to true.

Find the example bellow

function createSilverlight()
{
 Sys.Silverlight.createObjectEx({
  source: "Page.xaml",
  parentElement: document.getElementById("SilverlightControlHost"),
  id: "SilverlightControl",    
  properties: {
   width: "100%",
   height: "100%",
   version: "0.95",
   isWindowless:"true",
   background:"#00FFFFFF",

   enableHtmlAccess: true
  },
  events: {}
 });
}

Now run your application your silverlight control will be in transparent.

Hope this can be useful. Post your comments bellow.

No comments: