Today I have been working through the Microsoft QuickStarts for Silverlight, which include walkthroughs as well as code source. Here are the high level topics available:
Getting Started with Silverlight Development [Skipped]
Building Dynamic User Interfaces with Silverlight
Networking and Communication in Silverlight
Interaction Between HTML and Managed Code
Programming with Dynamic Languages
Additional Programming Tasks
Notes to Building Dynamic User Interfaces with Silverlight:
A. Writing Handlers for Silverlight Input Events [Skipped] -- this is covered in most introductory materials. Didn't see a point in reviewing it.
B. Changing the Appearance of an Existing Control in Silverlight -- this is interesting, since it covers both styling an app as well as skinning it with ContentTemplates. ContentTemplates do more than set properties for certain elements in your Silverlight app the way CSS does for HTML elements. They also let you switch out your Silverlight element with a custom element such that, say, everywhere you have specified a button in your app, you now get whatever is created in the button's ContentTemplate. It works a bit like a global replace. On the other hand, whatever events you have hooked up to your button in order to fulfill business requirements will still work, whatever you do with the ContentTemplate.
This QuickStart is mostly a copy / paste sort of tutorial. That said, there are some errors in it such that, if you follow the instructions to the letter, you will end up with a useless application that hangs.
C. Creating Custom Controls for Silverlight -- an eye opening walkthrough. We create a custom Silverlight control by first creating a standard class that inherits from Control, and a separate XML file with an xaml estension. XML file is aware of the control class, but the control class knows nothing about the XAML file. We reuse some of the ContentTemplate techniques from the previous QuickStart to give form to our Silverlight custom control. Here are some minor issues with the walkthrough:
public static readonly DependencyProperty BackgroundProperty = DependencyProperty.Register("Background", typeof(Brush), typeof(NumericUpDown), null); public Brush Background { get { return (Brush)GetValue(BackgroundProperty); } set { SetValue(BackgroundProperty, value); } }
public static readonly DependencyProperty BackgroundProperty = DependencyProperty.Register("Background", typeof(Brush), typeof(NumericUpDown), null);
public Brush Background { get { return (Brush)GetValue(BackgroundProperty); } set { SetValue(BackgroundProperty, value); } }
D. Displaying a Splash Screen While Loading a Silverlight-Based Application -- this QuickStart seems to work. I actually can't completely tell what's happening in the walkthrough, though it seems like it will make a great reference if I ever need to customize a splash screen.
E. Working with Data Collections in Silverlight -- this useful QuickStart explains data binding and the DataTemplate. No obvious errors, but a few lacunae.
Remember Me
a@href@title, b, blockquote@cite, em, i, strike, strong, sub, super, u
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.