- Published on
Windows Phone 7 and Silverlight Slider Binding Bug
- Authors
- Name
- Christopher Schleiden
- @cschleiden
It took me about 4-5 hours today to finally recognize why one my custom controls behaved in a strange way. It is a control derived from the Silverlight slider control and I encountered strange behavior when binding the Maximum and Minimum properties. After countless checks to make sure, that my ViewModel logic was flawless I finally discovered that … the order of attributes in the xaml code *does* matter when binding these exact properties.
It turns out, instead of this
<Slider Name="slider" Grid.Column="1" Minimum="{Binding MinValue}" Maximum="{Binding MaxValue}" />
it should be this:
<Slider Name="slider" Grid.Column="1" Maximum="{Binding MaxValue}" Minimum="{Binding MinValue}" />
Other people have noticed the same: http://dotnetbyexample.blogspot.com/2009/08/bind-silverlight-3-slider-value-minimum.html