Learning Silverlight: Day Five



Day five picks up with unsolicited errata and general notes for the remaining Quick Start tutorials from the Silverlight.net site.

Notes to Interaction Between HTML and Managed Code (there is only one tutorial in this section, as of this writing):

Accessing the HTML DOM from Managed Code — This is a pleasant tutorial showing how to use the Silverlight Host Control as basically a wedge between code behind and the HTML DOM.  From the user control hosted in the host page, you can basically grab the DOM of the container page and manipulate it.  Because there is a lot of code, this is primarily a copy & paste style of tutorial, which means some useful information is left out.  For instance:

  • If you name your Silverlight project qsHB, the code will work better, depending on how much you copy & paste and how much you write by hand.
  • The HTML controls you add to the Test html page should go in the same div tag that contains the Silverlight Host object.
  • By default, the dimensions of the Test html page generated with your project are 100% by 100%.  Change this to 10% by 10%, otherwise your controls will be off the bottom of the browser window.


Notes to Programming with Dynamic Languages (this section only has one eponymous Quick Start):

Notes to Programming with Dynamic Languages: [Skipped] — some day I may want to learn managed JavaScript, IronPython, or IronRuby.  Right now, however, I can’t really see the point.


Notes to Additional Programming Tasks (includes one Quick Start):

Using Isolated Storage and Application Settings — This tutorial walks you through working with the System.IO.IsolatedStorage.IsolatedStorageFileStream, which allows the application to store files in a sandbox on the server.  The application is very rich, which unfortunately means the tutorial itself involves a lot of copy — paste — compile.  To understand what is going on, you basically need to read through all the code you copy & pasted after it is all done.  When a tutorial becomes this complex (and to my chagrin I have written a few like that) it is perhaps best to give up on the idea of doing a tutorial and actually do a "lab", in which the code is already all written out, and the author’s job is merely to walk the reader through what is going on.  This is a cool little application, all the same, and I foresee using it as a reference app for lots of future projects.


Whew.  That’s it for the Quick Starts found on http://silverlight.net.  Tomorrow I’ll start on the labs.

One thought on “Learning Silverlight: Day Five”

Leave a Reply

Your email address will not be published. Required fields are marked *