Welcome to Pete Brown's 10rem.net

First time here? If you are a developer or are interested in Microsoft tools and technology, please consider subscribing to the latest posts.

You may also be interested in my blog archives, the articles section, or some of my lab projects such as the C64 emulator written in Silverlight.

(hide this)

Silverlight 2 ListBox Abuse

Pete Brown - 13 May 2008

During all my Silverlight and WPF talks, one point I try to make is that in those technologies, the important aspect of an out-of-the-box control is not its particular display properties, but its model and its ability to be customized.

Back when we used to do Windows Forms work, you often picked third-party controls based on how many UI customization tweaks they offered (fonts, colors, one or two values in a column, ability to have a drop-down list inside a cell etc.). In WPF and Silverlight, this is largely moot as the designer has a lot of flexibility with the user interface. Need to program against a listbox, but have the flexibility to have it look like a carousel? No problem, because the two are conceptually the same thing (list of items, way to navigate between them, one item is "selected" etc.).

This just came up on a Silverlight mailing list. I had forgotten all about this excellent set of examples. Be sure to check out the Silverlight 2 Solar System, Slide Show and Marquee examples, all of which are based on unusual uses of standard controls like the ListBox and ScrollViewer.

Below is a screenshot of one use of a ListBox

Planets shown smaller than actual size

       
posted by Pete Brown on Tuesday, May 13, 2008
filed under:        

3 comments for “Silverlight 2 ListBox Abuse”

  1. Tomsays:
    "Need to program against a listbox, but have the flexibility to have it look like a carousel? No problem, because the two are conceptually the same thing..."

    "No problem"? Actually there's a big problem. Listbox neither looks nor behaves like a carousel. The gap between these controls seems far too wide to be bridged by a designer through "UI customization". Who's going to write the layout algorithm? The animation system? The configurable acceleration, deceleration, drag and drop, you name it. All of the stuff that makes a carousel a carousel, that a listbox knows nothing about. I don't think UI customization is going to cut it. Unless by "look like a carousel", you meant it in a VERY limited way.

    Sure, controls quite often have some things in common (like a collection of items, concept of a selection, etc). But I don't think this makes them "conceptually the same thing".
  2. Pete Brownsays:
    @Tom you're right, there is often more to it to create an advanced carousel. Time permitting, I'll put together something more along the lines of what I was thinking.

    I'd also like to note that in WPF you actually can get much further without any code, as it has better support for triggers and binding.

    Pete

Comment on this Post

Remember me

4 trackbacks for “Silverlight 2 ListBox Abuse”

  1. POKE 53280,0: Pete Brown's Blog : Silverlight 2 ListBox Abusesays:
    PingBack from http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2008/05/13/Silverlight-2-ListBox-Abuse.aspx
  2. POKE 53280,0: Pete Brown's Blog : Silverlight 2 ListBox Abusesays:
    PingBack from http://community.irritatedvowel.com/blogs/pete_browns_blog/archive/2008/05/13/Silverlight-2-ListBox-Abuse.aspx
  3. Christopher Steensays:
    Sharepoint Web Parts the Simple Way - Use User Controls [Via: janiver@microsoft.com ] ASP.NET Developer...