Saturday, December 27, 2008
I would like to share some of my basic understanding of Silverlight internals in this series.
XAP File
When you build a Silverlight 2.0 application, the final outcome would be:
1. ApplicationName.dll
2. AppManifest.xaml
3. ApplicationName.xap
When a request is made for a page which contains a Silverlight, the server sends the page with the Silverlight part as "xap" file to the client. The XAP is a normal archive file you use archive manager like 7-Zip to extract the content. It contains RequestSilverlightApp.dll and AppManifest.xaml. The silverlight CLR at the client side consumes these. This should be specified in either ASPX or HTML file which is the actual client requested page.
You use OBJECT tag along with DIV and IFRAME to load Silverlight host and specify the target XAP needs to be loaded.
<object data="data:application/x-silverlight,"
type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="HelloSilverApp.xap"/>
In your ASPX, you can use ASP.NET server side control to specify Silverlight host and specify the target XAP. In the above declaration, the XAP file has been specified in the "source" parameter.
<asp:Silverlight ID="Xaml1" runat="server"
Source="~/ClientBin/HelloSilverApp.xap" MinimumVersion="2.0.31005.0"
Width="100%" Height="100%" />
In the above declaratin, the XAP file has been specified in the "Source" attribute.
Labels: silverlight
0 comments:
Post a Comment