Home > View Post

A Silverlight 2 Databinding Cornucopia

Recently I presented at FEST '08 and at the beginning of my session I demonstrated a WPF databinding cornucopia (!). I've since been asked if it's possible to do the same thing in Silverlight 2, and it is:

Just grab the slider and move it from left to right to see the demonstration in action (if you can't see the demo in your RSS reader click here)

Note that I've had to use the Workaround for the missing ElementName on SL's Binding object that I've posted about previously. Also, I had to use a number of IValueConverters to complete the effect.

I even threw in the now infamous Josh-o-meter gauge control (AKA the feedback-o-meter and lunch-o-meter) and made it databinding friendly.

Despite the workarounds I think you'll agree that it's a pretty impressive demonstration of Silverlight's binding functionality. Notice how you can move the slider, the scrollbar or even enter text into the textbox and all the elements will respond to the change (you'll need to tab out of the textbox for the change to take effect).

Why not check out the source code...

Source Code

As usual, this is SAMPLE CODE and has not been optimised. It has been written in a short time for a personal project and as such hasn't been subject to a great deal of testing. The content is provided "as is" without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

Tags: Silverlight

Josh Post By Josh Twist
5:02 AM
30 Jun 2008

» Next Post: Anonymous Delegates, how I love thee
« Previous Post: Updated Silverlight Uploader for SL2 Beta 2

Comments are closed for this post.

Posted by John "Z-Bo" Zabroski @ 16 Jul 2008 7:04 PM
Your "click here" link is broken.

Posted by Josh @ 16 Jul 2008 11:57 PM
Oops - fixed now. Thanks :)

Posted by Matt Casto @ 19 Aug 2008 8:16 AM
I had something similar to that in a presentation I did a few months ago, but I like yours a lot more.

Do you mind if I use it for future presentations?

Posted by Josh @ 19 Aug 2008 8:18 AM
In exchange for a link?

Only kidding - of course you can use it. :)

© 2005 - 2022 Josh Twist - All Rights Reserved.