Observing Silverlight From a Speeding Car - Shawn Oster
Shawn Oster (gravatar)

Observing Silverlight From a Speeding Car

I've been putting myself through a crash course on Silverlight\WPF these last few days and here are a few random thoughts.  All of this is after a 60 minute breakneck tour of WPF\Silverlight so I'm more than likely missing a whole bunch of things and probably doing things bass-ackwards but hey, that's why they call it learning.

  • There are three stock layout managers (used for placing controls): Canvas, Stack & Grid.  Where is the CSS-style panel?  If designing web pages has taught us anything it's that the grid quickly gets cumbersome.  Note to self if I get hired at Microsoft: Create a CSSLayoutPanel that uses stock CSS to position the controls.
  • I forgot how painful an experience it is to enter XML in Visual Studio.  I've been spoiled by Intype and E TextEditor where you don't need to enter the opening angle bracket to get code completion.  Also, I must be doing something wrong because entering XML attributes is downright painful in Visual Studio.  This is where I'm stuck:
    • Type "<ColumnDefinition "
    • Type "W", brings up Intellisense
    • Tab to complete, you now have Width=""
    • Type "50"
    • Now what?  How do I get beyond the ending quote without a lot of keyboard gymnastics?  I can press Right Arrow or End but they're not quickly reachable from the home row.  I can just type another quote but instead that'll just add a second ending quote which isn't what we want.  What should really happen is that I should be able to press Tab to tab out of quotes and put the caret one space past the ending quote.  This is how TextMate, Intype and E all handle this and it works wonderfully.
  • There needs to be a nice bundle of XAML specific code-snippets.  The argument that all "real" design work is usually done in something like Blend is crap because even with all the great GUI builders like Delphi, Visual Studio, Dreamweaver, etc. people are still constantly dropping down to the code to get that pixel perfect design so might as well offer up some snippets to make it easier.
  • I'd like to talk to the person that decided that Silverlight's margin property should list margin in "L T R B" order while CSS defines it as "T R B L".  It's not exactly a horrible idea but why pollute the knowledge space needlessly and make people remember two almost identical things?  There are obviously a lot of similarities between XAML and semantic XHTML yet instead of easing the transition by reusing common usage patterns they decided  to make things just a little different.  Annoying.
  • For all my whinging defining UI via a markup-style language is definitely a plus, regardless of the angle bracket tax.
  • I wonder if you could represent XAML or WPF as YAML instead?  Staring at all the XML about breaks my head in two.
  • Printing, is that even a possibility with Silverlight?  How many times have I printed something from a web page with zero control over margins, headers, footers, etc.  Seems some very cool label printing applications could be whipped up in Silverlight as well, CD labels, shipping, etc.


  • Brad (gravatar)

    Brad said
    June 06, 2008

    Did my own learning project in silverlight. I love it, but I agree on the margin order (who wouldn't notice that right away?) and YAML. It's a crying shame about YAML in general. So superior yet with absolutely no chance for gaining a foothold.
    As for printing, it seems like one might be able to make the XAML into XPS?
    It would be cool for label printing, though :)
    The thing that struck me is that this is the direction MS was headed all along for rich client functionality (read that in RedmondDeveloper), but they just got hit by the AJAX bus. Silverlight is [b]so much cleaner[/b] than AJAX...

  • Silverlight to me is a bit of sleeper tech, people aren't understanding just how powerful it can be when you consider you can apply all your C# Fu into cross-platform, cross-browser RIAs. I think when the collective light bulb goes off it'll really explode given how many people are already familiar with C#. I think a richer, more complete control story and greater WPF feature parity &amp; compatibility will really allow the tech to explode.

    Yeah, I asked about the margin order and got back the answer that totally made sense if I would have thought about it. The guys doing WPF were coming from WinForms, coming from Win32 and as we all know all coordinates are given in Left, Top, Right, Bottom order. That brought up a good point and a question I think XAML has to answer, is it more a Win32 replacement or a richer semantical markup language a la XHTML/CSS? There will be a clash as the two camps start to merge into the same buffet line.

    Agreed about YAML, love it. Though with IronRuby there is going to have to be a solid .NET YAML parser and perhaps some edge community can push that and create a YAML -&gt; XAML converter.

    Completely agree Silverlight is much cleaner than AJAX, but of course they are two different beasts. AJAX is no install, very fluid, very cross-browser and platform, etc. while Silverlight is just that notch up in experience. I can't see requiring Silverlight just to get a nice auto-complete dropdown. Of course the fun part is you can use AJAX with Silverlight for some neat tricks.

    It's funny, while JavaScript is fairly messy from a structred point of view some very impressive things have come out of there. Just the Prototype/script.aculo.us toolkits make life so much easier and I'll probably put a dent in MS chances by saying I think the AJAX story in those toolkits is actually easier to use and understand, just as long as you're comfortable with more than just the basic drag &amp; drop development style of WebForms.

  • good article

Your Information
Mrs. Gravatar (gravatar)

<-- It's a gravatar

your comment