Home > Uncategorized > My notes from the First Look at Silverlight 2

My notes from the First Look at Silverlight 2

February 22, 2008

Today, Scott Guthrie posted a First Look at Silverlight 2 as an hearty appetizer before the first public beta of Silverlight 2.  (Notice the “2” and not “2.0” anymore.)

Along with his overview he built a simple Digg client and 8 tutorials on how this is done using the new features in Silverlight 2.  I’ve read through each Tutorial and I thought I’d share my notes and comments:

Part 1: Creating “Hello World” with Silverlight 2 and VS 2008

  • New Project Templates – Very simple to create a new Silverlight application and accompanying test web application.  You can also see that there is the option to Add the application to an existing Web Application as well, which is a more likely production scenario.
  • Application package (.xap) – One compressed file to reference that instantiates your application by way of the object tag.  Beauty!  This will make it much easier to embed Silverlight applications. 
  • VS Support – XAML intellisense, code intellisense and shortcuts for event handler creation.

Part 2: Using Layout Management

  • Stack Panel – arranges controls horizontally or vertically based on control size and margin
  • Grid – very powerful multi-row, multi-column layout in some ways similar to an HTML table.  I really like that it uses attached properties for placement rather than an embedded structure.
  • Controls -Border control is nice, and he also mentioned the WatermarkedTextBox.  Not only is there a TextBox now (yay!) but there’s a watermarked sub class.
  • Resize the Application – Smart vector-based UIs are a beautiful thing.

Part 3: Using Networking to Retrieve Data and Populate a DataGrid

  • More than before -“call remote REST, SOAP/WS*, RSS, JSON, and XML HTTP”, that just speaks for itself.
  • Cross Domain Access – respecting the cross-domain policy file, another huge deal
  • LINQ to XML – I just recently started using LINQ and its just plain fun, even if you’re not a total data geek.

Part 4: Using Style Elements to Better Encapsulate Look and Feel

  • Style – If you’re used to CSS or WPF Styles, the ship has arrived.  Its time to leverage your skills and make that UI you’ve always wanted. Or just happily minimize the size of your XAML files by reducing repeated code.

    This is one of my personal favorite new features and I’m looking forward to talking about it more.

Part 5: Using the ListBox and DataBinding to Display List Data

  • Listbox – another thankful addition to the Controls now available
  • Databinding – another feature like LINQ that I have just started using more, like ASP.NET databinding but a little different.  Definitely take a look at the DataTemplate.

Part 6: Using User Controls to Implement Master/Details Scenarios

  • User Controls – Great VS Support for the type of encapsulation you have comfortable with in .NET.  You can do this in 1.0 with JavaScript and XAML, but its just not as easy as this.  Definitely useful when Striving for Reuse.
  • Using DataContext – …leads to Binding availability, definitely worth looking at Scott’s sample to know why this is exciting.

Part 7: Using Templates to Customize Control Look and Feel

  • Content property -more goodness from WPF, the Button has a Content property not just Text, because you can redefine the Content as needed.  Need a button with an Image icon, just redefine the Content instead of building a new button.  +1 for composition.
  • Control Template – even more powerful than styling, you can completely reskin the control by redefining its template.  Go from the standard rounded rectangle to an animated themed button and maintain all the interactivity and events.

Part 8: Creating a Digg Desktop Version of our Application using WPF

  • Copy and Paste –  Copy and paste the code into a WPF application and after two small changes you now have a desktop application.  Nice.
%d bloggers like this: