Summary: Setting the 'Maximum' property to a value less than the 'Minimum' property causes any binding on the
'Maximum' property to break.
I have a control that has the following bindings:
<telerik:RadNumericUpDown
Minimum="0"
Maximum="{Binding Path=SnapshotCount, ElementName=GameDisplay, Mode=OneWay, Converter={StaticResource
SnapshotCountToMaxIndexConverter}}"
Value="{Binding Path=SnapshotIndex, ElementName=GameDisplay, Mode=TwoWay}"
/>
The problem is that when the SnapshotCountToMaxIndexConverter converter returns a value less than the minimum (in my particular case it was returning -1) then the following code is triggered to execute in RadRangeBase.cs:
private void CoerceMaximum()
{
if (this.Maximum < this.Minimum)
{
this.SetValue(MaximumProperty, this.Minimum);
}
This appears to break the binding because afterwardsI can see via breakpoints that the
OnMaximumPropertyChanged() method is no longer called.
The net effect of this is that the control becomes unusable because the only value that can then be entered into the field is the minimum value since the minimum and the maximum values are the same and the binding doesn't update what the maximum should be.
Interestly, I also have the exact same binding on a RadSlider() and the binding does not appear to break for that control.
NOTE: This problem is easy to avoid by ensuring that you never specify a maximum value that is less than the minimum.
PS: I love the controls by the way.