Wednesday November 12 2008 04:27
I'd ignored Silverlight for a while, as there are other things to play with and it didn't look too mature. With Silverlight 2.0 things are looking better. Couple that with the lack of free tools for Flash development, the superiority of C# to ActionScript, the fashionable nature of words ending in "q", and I thought it was worth a peek. The obvious place to start was an image gallery, although sadly Silverlight doesn't seem to support colour management. Perhaps all marketing people are colour blind or something.
Anyway, there is "deep zoom" which looks like an amusing component for a Google-Earth style photo gallery... lay out all your pictures on the screen, then let people zoom in to see what they want. Microsoft doesn't do much documentation these days, which is frustrating. There are lots of little videos which take about 15 minutes to tell you where the "save" button is, but otherwise it's essentially you and google with this stuff. There are lots of example bits and pieces around, many based on earlier versions of the Silverlight framework. A few people have built a little more on top of the basic free code. So that was my starting point. Mostly I stole things from here (basic infrastructure stuff) and here (decent image layout), and here (multiple tag handling), here (tag cloud control), and finally here (wrap panel).That's a lot of thieving and restructuring for one simple thing, but then it will all get easier with time I'm sure.
The stuff you can find on the web is all very clever, although some of it a bit too much so. I stitched it all together and added some extra tweaks.
Overall it feels a bit like Windows development did in the early days, where you had a huge amount of complexity to deal with just to make something fly. Take a look at the styles in the XAML for this stuff - it's semi-machine-generated tat which you really don't want to read. I'm sure that'll improve in due course; it needs to. On the other hand, the attraction of programming in one system for everything from browser computation, through server-side stuff, and also programs running on the desktop has to be a good thing. Flash has been pretty much all there was for ever and a day, and you have to pay for the development tools. This on the other hand is free, it uses a grown-up programming language, and it's the same stuff you use for .NET.
So here you go... a simple Silverlight Image Viewer.