Showing posts with label silverlight. Show all posts
Showing posts with label silverlight. Show all posts

Saturday, December 27, 2008

Inside AppManifest.xaml
The file contains the following:


<Deployment xmlns="
http://schemas.microsoft.com/client/2007/deployment"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
EntryPointAssembly="HelloSilverlightApp"
EntryPointType="HelloSilverlightApp.App"
RuntimeVersion="2.0.31005.0">
<Deployment.Parts>
<AssemblyPart x:Name="HelloSilverlightApp"
Source="HelloSilverlightApp.dll" />
</Deployment.Parts>
</Deployment>

The manifest specifies the entry point assembly which should be loaded by the Silverlight host and within the assembly it requires a type derived from System.Windows.Application for start executing the application.

Here, the assembly is “HelloSilverlightApp.dll” and type is “App” in the namespace HelloSilverlightApp.

Warning: System.Windows.dll is part of Silverlight and not the one we used for WinForm development.
I read in some web sites those explained that XAP also contains a set of required Silverlight assemblies which are needed by this application. But I tried with lot of examples, the XAP contains application's assembly and this manifest. Need to check.

Inside HelloSilverlightApp.dll Assembly

It contains two parts:

  1. The typical .NET type declaration of specific Siverlight application's App and one or more Page. In this example,

    1. HelloSilverlightApp.App

    2. HelloSilverlightApp.Page

  2. Resource: HelloSilverlightApp.g.resources. It contains the declarative artifacts of this application:

    1. page.xaml

    2. app.xaml

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.

Sunday, October 26, 2008

Since I was mostly spent my time on behind-the-scene technology, I had put a hold on "Silverlight". Also, I am waiting for its final customer release.

Installed all Silverlight ingredients on my Visual Studio 2008 box successfully. Struck up with VS2008 SP1 update, because of its online 781MB installar size. Finally, I got an offline installar and finished all formalities.

I was starting the journey with Silverlight Web Script project. Created the following:

1. HelloWorld.xaml
2. HelloWorld.js
3. HelloWorld.html

When I tried to open in my browser, nothing was displayed. ;)

After a WinMerge comparision of HelloWorld.html with Default.html, found the issue that
<script .../>

So, use <script></script>

Yes, <script/> gives lot of trouble in normal HTMl also.

Okay, let me continue the journey.