I set property Maximum = 2000, if i have entered any number greater than 2000, it's sets back to number which has been set before, but not maximum number as I want, maybe I didn't set some property to keep maximum if input value is greater than maximum. I think that the same problem is with property minimum."
Note: On version 1.6 it worked as "Epsi0neR" expected.
Comments: ** Comment from web user: RMedeiros3 **
http://stackoverflow.com/questions/8084364/wpf-toolkit-integer-updown-does-not-retain-value-on-lostfocus
This is a the way Toolkit works. To change value to maximum or minimum when user types in the value that is out of Min-Max bounds, you should download WPF Toolkit sources (http://wpftoolkit.codeplex.com/SourceControl/changeset/view/98195) and change file CommonNumericUpdown.cs in folder Xceed.Wpf.Toolkit/NumericUpDown/NumericUpDown like is given below. Note the lines before the exceptions are throwed, they are added.
private void ValidateDefaultMinMax( T? value )
{
// DefaultValue is always accepted.
if( object.Equals( value, DefaultValue ) )
return;
if (IsLowerThan(value, Minimum))
{
Value = Minimum;
throw new ArgumentOutOfRangeException("Minimum", String.Format("Value must be greater than MinValue of {0}", Minimum));
}
else if (IsGreaterThan(value, Maximum))
{
Value = Maximum;
throw new ArgumentOutOfRangeException("Maximum", String.Format("Value must be less than MaxValue of {0}", Maximum));
}
}