Patrick Talmadge
Silverlight Binding Linear Order
I stumbled across this Silverlight “feature” today. Silverlight’s binding works in a linear order.
1 | <ComboBox SelectedValue="{Binding SelectedHour, Mode=TwoWay}" ItemsSource="{Binding Hours}" /> |
In the above code, selected value isn’t being set on page load. When I change the ComboBox my SelectedHour ViewModel property was being updated with a new value. This let me know that my binding is working. In further debugging I noticed SelectedHour property was being accessed before the Hours property. The binding was trying to set the selected value but the ComboBox was ignoring it because it didn’t have any values. For fun I tired moving ItemSource binding in front of the SelectedValue binding.
1 | <ComboBox ItemsSource="{Binding Hours}" SelectedValue="{Binding SelectedHour, Mode=TwoWay}" /> |
Everything started working perfectly. Now I know to watch the order of my XAML properties in Silverlight.
My Twitter
- Apple should allow people to pre order unannounced products just to see who the real #apple #fanboys are. 20 hours ago
- Started the SAAS class http://t.co/LV2EitqG Just wish it wasn't so Rails oriented. Not everyone is a #RoR #fanboy. 2012/02/21
- I can wait for the purse dog fashion statement to go away. I don't need to see your dog in the mall. 2012/02/18
- Nothing like early morning coding. Client side code clean up. #jquery #ui 2012/02/18
- RT @newsycombinator: I would rather drink piss like Bear Grylls than log in with Facebook http://t.co/4cb0kyiJ 2012/02/17
- Yesss!, @chi_llc followed me back. Woot... Woot... bring on the 3D software tweets :) 2012/02/17
- Bye Bye, Hulu+... & your silly content deals. Why can't I watch some shows on my TV! Mountian Lion just put the final nail in. 2012/02/16
- Mountain Lion looks cool. http://t.co/QFdtKD68 but I really hope Apple doesn't screw up #OSX by turning it into #iOS. 2012/02/16
- I have to say mustache.js makes front end development super easy #mustache #jquery 2012/02/15
- Nothing says Valentines Day like Twitter Spam. Thanks for the link, random spam bot with half naked picture. I'll click it later, trust me! 2012/02/14
Archives
- December 2011
- October 2011
- August 2011
- June 2011
- April 2011
- March 2011
- February 2011
- December 2010
- November 2010
- October 2010
- August 2010
- June 2010
- May 2010
- April 2010
- March 2010
- February 2010
- January 2010
- December 2009
- November 2009
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009
- May 2009
- April 2009
- March 2009
- February 2009
- January 2009
- December 2008
- November 2008
- September 2007
- July 2007
- June 2007
- April 2007
- March 2007
- February 2007
- January 2007
- December 2006
- November 2006






