Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Silverlight work? [closed]

Can anyone point me to a link with detailed description on how Silverlight works. I mean in the sense that, does it run as a separate process or does it run in the same process as browser? Does the silverlight plugin responsible for parsing the XAML and rendering the Silverlight run in the same address space as the browser? Basically more details on how exactly the silverlight code is parsed and rendered and the process which take cares of it and where does this process run?

TIA

like image 624
srd Avatar asked Nov 05 '22 11:11

srd


1 Answers

I haven't seen any info on the depth you are looking for. So, follow some bits I know.

How Silverlight runs depends on the browser plugin architecture. Take a look on the following links: http://blogs.msdn.com/b/jstegman/archive/2008/12/21/silverlight-browser-support.aspx http://kb.mozillazine.org/Plugin-container_and_out-of-process_plugins This link has a tiny bit about what you are asking (SL1): http://help.outlook.com/en-us/140/bb412366.aspx None of those links above dive the depth you are looking for.

All I know is that Silverlight plugin is a runtime environment, just like .net or the java vm.

The code written for a Silverlight app (c#, vb, f#) is compiled first, packed and compressed in a xap file

In IE Silverlight uses ActiveX technology. In other browsers it uses NPAPI.

Source code is not parsed/interpreted at runtime. A Silverlight app is in binary format, just like a regular .net app.

The xap file is the unit of deployment that contains binaries (dll) and content (xaml, images, ...). Visual Studio takes care of generating the xap for you. But you can do it all by yourself too. The xap extension is just a zip file renamed.

Once a xap file is received by the browser, the plugin kicks in and unpack and execute the app.

AppManifest.xaml (a file within the xap) tells the plugin which class is the entry point. When a Silverlight app is running, only the Xaml part of a UI control is parsed at runtime. Inputs are handled first by the browser and then by the plugin. In general, you don't care much about it, but it does have some consequences.

The Silverlight plugin is also able to render Xaml directly embeded within the Html.

The plug in is able to interact with the page and can expose object model to JavaScript, and the app can also invoke JavaScript functions and interact with DOM.

If designed for that, a Silverlight app can also run outside the browser.

like image 67
Klinger Avatar answered Nov 16 '22 17:11

Klinger