Welcome to MSDN Blogs Sign in | Join | Help

A better web is coming [Silverlight 2 is on the way!]

On Friday, Scott Guthrie posted a "first look" at Silverlight 2. My boss, Shawn Burke, followed with a post about his team's involvement. I've already demonstrated my fondness for Silverlight, so now you know what I've been up to recently. :)

ListBox/ScrollViewer Intro My contribution to the Silverlight 2 effort was to write the ListBox control along with its ever-present sidekick, ListBoxItem. Because I needed to support bi-directional scrolling in ListBox, I figured it would be good to add ScrollViewer and its buddy ScrollContentPresenter for consistency with WPF. For people who don't live and breathe API definitions, MSDN offers a ListBox Overview and ScrollViewer Overview that summarize the key points of both controls. (Note: These links are all to the documentation for the WPF controls. Because the Silverlight implementations are subset-compatible, they give a great idea how the Silverlight controls will work, too.) For folks who want a taste of actual Silverlight 2 hotness, I've included an image of these controls being used in very simple scenarios to the right of this text. For images of the Silverlight 2 ListBox (and therefore ScrollViewer) being used in a real-world scenario, have a look at Scott's Silverlight tutorial - particularly part 5 where he introduces the ListBox and shows off some of its coolness.

I've had a lot of fun working on these controls and am planning to blog more about them once the Silverlight 2 beta is publically available. I'm thinking of starting with an FAQ-like document that touches on some of the more interesting implementation details and gives example code for some common scenarios. After that, I'm going to post a few simple applications to demonstrate more complex scenarios. And after that... we'll see how things play out!

Silverlight 2 looks like it will really improve the web experience for everyone - it'll be great to see what customers think once they get their hands on it!

PS - I'll be attending MIX08 next week and would be happy to chat about any of this in person. So if you're going to be in the Las Vegas area and want to get together, send me a note and we'll try to set something up!

Published Sunday, February 24, 2008 11:51 PM by Delay
Filed under:

Attachment(s): ListBoxScrollViewerIntro.png

Comments

# MSDN Blog Postings » A better web is coming [Silverlight 2 is on the way!]

# re: A better web is coming [Silverlight 2 is on the way!]

Monday, February 25, 2008 3:35 PM by jackbond

Out of curiosity, what was involved in writing the ListBox control? Did you start with the full WPF ListBox code and start trimming?

# re: A better web is coming [Silverlight 2 is on the way!]

Monday, February 25, 2008 5:06 PM by Delay

jackbond,

Two of the goals for the Silverlight 2 controls were compact size and WPF-compatibility. As you note, one approach would have been to start with the WPF implementation of ListBox and try to trim the unnecessary stuff. However, it's been my experience in the past that doing so isn't always as effective as it might seem. What we did instead was to write the Silverlight 2 controls from scratch to be API-subset-compatible with WPF and with heavy inspiration from the corresponding WPF implementations. (For example, if you were to look at the ListBox code you'd see that many of the internal methods share the same names across both the Silverlight 2 and WPF implementations.) By doing things this way, we were able to target exactly the set of features Silverlight offers, use them just as they were intended to be used, and do so without taking on unnecessary architectural overhead.

As an aside, I took a few additional steps to ensure WPF compatibility - but I can't get into the details quite yet. Stay tuned... :)

# Silverlight Cream for February 25, 2008 -- #208

Monday, February 25, 2008 10:23 PM by Community Blogs

Delay blogged some SL2 controls info, Shawn Burke's SL2 article, Imran Shaik on SL, Flash and the

Anonymous comments are disabled
 
Page view tracker