Rob Ashton

SLJS.org - a Silverlight - Html/JS converter

At NDC2011 I was chatting to some folk who work on various OSS projects about cool things we could potentially work on in the future, and the topic of a Silverlight -> Web converter came up

TLDR: Click here to see the demos, click here to see the code, click here to view the Google Group.

I had thought about this before, but it is only recently that an IL converter appeared up that I deemed fit for this purpose (JSIL), and it is after this conversation I decided to put words into action

To this end, I have spent the past few weeks diving into the various concepts in Silverlight and spiking out implementations for converting them to make sure that the vast majority of what I wanted was actually possible

And that leads us to this, SLJS.org, home to where I've gotten so far, with a couple of demos showing off what it can do. More to be added as we go along.

  • Here is a basic example of an application in action: Hello World (Silverlight, HTML)
  • And here is something demonstrating some more SL concepts: Calculator (Silverlight, HTML)

Truth be told I'm largely doing this for fun and education at the minute, although I know a few people who actually want to use it - not to convert legacy projects, but to write new code in their familiar Silverlight world and have it work in a browser without requiring a plug-in.

I'm happy to support that, but it should be a community effort, rather than me blindly just working on features for the sake of it (although I have a little more of that left in me before I start taking on feature requests!)

So far the following has been implemented

  • Bootstrapping a converted Silverlight application in JavaScript
  • Responding to changes of the root UI element
  • Rendering a control hierarchy from the root UI element
  • Rudimentary Dependency Object and Dependency Property support
  • Listening for changes on Dependency Properties to update styling
  • Listening for changes on Dependency Properties to update content
  • A templating system for customizing the output from each control

On my immediate road-map (so in the coming week), I'll be working on:

  • Rudimentary data-binding support (A spot of MVVM coming up)
  • Converting styles to CSS
  • Going through System.Windows.Controls and creating the outline for them in JS
  • Forcing some layout concepts into HTML from Silverlight
  • A preliminary investigation into attached dependency properties

I would totally appreciate some help/feedback/pointers for the direction of the project/cheering from the sidelines etc

The last one is important actually, if y'all tell me you find this interesting then I'll carry on working on it, if nobody gives a crap then when I get bored I'll stop :-)

But yeah, just joining the Google Group and helping me build a road-map would be a good start