Page view counter

The Great Asynchronous Learning Experiment - Day 4

I started to move on, but then a friend asked me to explain how the pieces of a Silverlight application all fit together. I found myself doing a bit of hand-waving when it came to the relationships among

  • default.html
  • default.html.js
  • scene.xaml
  • scene.xaml.js

I knew how it worked, it just wasn't internalized enough to really be able to explain it, and as Richard Feynman (or Albert Einstein)  may or may not have said "if you can't explain it simply (or to a first year grad student, or to a six year old), then you don't understand it yourself." [This would be a great quote if there weren't so many variants and if it were properly attributed].

In any case, I got curious, so I created the starter project you get when you use the Javascript template for Visual Studio, and I walked through it step by step. It turned out to be pretty interesting (at least to me) so I made a video of of the process (should be posted today or tomorrow).

While I was at it, I did a big hand wave about the Sivlerlight object itself. We know it is created it silverlight.js but that is some ugly javascript (excuse me, very beautiful and efficient javascript but not easily read). So class, your assignment is to parse that file and annotate it. Any takers?

 By the way, it turns out that when you take apart the relationship among these four files you find out two interesting things:

  1. It is all rather straight forward
  2. You actually knew all this already, you just didn't quite know you knew

I've shown this to a number of folks and they all had the same reaction. That said, I think you go forward with a touch less confusion. I hope you find the same.

 -jesse

 

Published Monday, August 20, 2007 12:05 PM by jesseliberty

Comments

# The Great Asynchronous Learning Experiment - Day 4 - Jesse Liberty - Silverlight Geek

Pingback from  The Great Asynchronous Learning Experiment - Day 4 - Jesse Liberty - Silverlight Geek

# The Great Asynchronous Learning Experiment - Day 4

I started to move on, but then a friend asked me to explain how the pieces of a Silverlight application

Thursday, August 23, 2007 10:38 PM by Test

# The Great Asynchronous Learning Experiment - Day 5

The following is part of a continuing "fantasy learning experience" of a .NET programmer learning

Monday, August 27, 2007 9:52 AM by Jesse Liberty - Silverlight Geek

# re: The Great Asynchronous Learning Experiment - Day 4

Well, I hope this doesn't violate the license agreement, but you can find an annotated Silverlight.js file here:  www.michaelhamrah.com/.../silverlight.js

It was interesting to see how the Silverlight.js file was minimized.

As for the relationship, Default.html calls a JS function declared in Default.html.js, which kickstarts the Silverlight runtime by passing in various initialization parameters to CreateObjectEx(), which is declared in Silverlight.js, which builds the embed or object tag specific for each browser, and then lets the runtime handle the rest (parsing the .xaml file)!

Wednesday, September 05, 2007 9:00 PM by mihamrah