Quick Silverlight Tip: Initialization Parameters

Sunday, June 29, 2008

The scenario: you developing Silverlight application, and you need to pass some parameter inside - for example to define which page will be shown, or to pass user credentials, after he already logged-in in previous non-Silverlight part of application. So, ho you could do it? The answer is pretty simple - "initParams" in Silverlight object construction. The parameters could be named, and not named. Named parameters example: <object data="data:application/x-silverlight," type="application/x-silverlight-2-b2" width="100%" height="100%"> <param name="source" value="ClientBin/InitParams.xap"/> <param name="onerror" value="onSilverlightError" /> ...

Quick Tip: Silverlight Integration within HTML content

Thursday, June 19, 2008

Couple of days ago I've got question, how Silverlight content could been integrated/overlapped by some HTML/AJAX content. The samples I've received produced following behavior - When clicking on hyperlink, it opens "modal pop-up" but Silverlight control is floating over it:   Another sample: When clicking on "Click Here" button HTML "window" being placed behind Silverlight control: Now the quick tip: When you need to make layering, positioning, etc. integration of your Silverlight content and HTML content you have to define "Windowless" parameter for Silverlight object: <asp:Silverlight ID="Xaml1" runat="server" Source="~/ClientBin/AjaxModal_SL.xap" Width="600px" Height="600px" Windowless="true" /> or <object data="data:application/x-silverlight," type="application/x-silverlight-2-b2"...

Silverlight 2 & CreateSilverlight()

Sunday, March 16, 2008

Current Silverlight 2 Beta by default doesn't using silverlight.js/CreateSilverlight() functionality we used to add Silverlight in Alpha version, but Silverlight directly created on page as object: 1: <div id="silverlightControlHost"> 2: <object data="data:application/x-silverlight," type="application/x-silverlight-2-b1" width="100%" height="100%"> 3: <param name="source" value="SilverlightApplication4.xap"/> 4: <param name="onerror" value="onSilverlightError" /> 5: <param name="background" value="white" />...