I'm wondering if you can suggest an approach to achieve an effect I want (which I describe below). I don't think so but I thought I would check.
I'm using a NumericUpDown to show length values of type double. I want to be able to make the Up/Down buttons change the displayed value to an even multiples of a a whole number, regardless of the starting value or the direction (up vs down) of the button they hit. Is there a way to do this?
For example, suppose the initial value is 1.23.
If the user hits the "Up" button, I want the value to change from 1.23 to 2.00. But the next time he/she hits it I want it to change from 2.00 to 3.00
But if the user hits the "Down" button, I want the value to change from 1.23 to 1.00. The next time, I want it to change from 1.00 to 0.00
If there were separate "SmallChange" properties for the up and down directions, this would be easy. I could bind them and do the math whenever the value changes. But I only have the one "SmallChange" property.
If there were some way for me to insert a "CoerceValue" callback into the "Value" property, I could do that. But I don't believe that is possible. If it is, please tell me how
Is there any way to achieve this?