0

I'm using IntegerUpDown from the WPF toolkit and I'm binding the minimum, maximum, and value properties.

When the view loads, some of the values in the IntegerUpDown control display "0" (invalid input which I can't touch) even though the minimum is set via the binding to "1" (I can't touch this either).

Why does this happens? Why doesn't the minimum enforces the minimum check on screen load? When I scroll down the view probably refreshes as then the app crashes.

Any idea on this issue will be great

Charles
  • 50,943
  • 13
  • 104
  • 142
shahar eldad
  • 861
  • 1
  • 12
  • 31
  • Just to clarify, you're saying that 0 is being bound to `Value`, even though that's not a valid value, and you can't change that? Seems odd to me that your model would be allowed to be in an invalid state. I don't think you can do anything with the binding order. There might be something to those particular properties though. I'll have a ponder... – Tim Dec 10 '12 at 15:09
  • The data is received from a server which can communicate with a parent application where in some cases this value is valid. I hope if I'll know what is causing this I'll know how to solve this the "right" way. – shahar eldad Dec 10 '12 at 20:29

1 Answers1

0

I ran a test: I added a converter to each property and found that the order of the properties when writing the control in xaml is the order how they are bound. My control was written as follow:

<toolkit:IntegerUpDown Value="binding" Min="binding" Max="binding"/>

Once I inverted the order of the properties as follow:

<toolkit:IntegerUpDown Min="binding" Max="binding" Value="binding"/>

The screen crashes on load as expected.

Hope this helps.

shahar eldad
  • 861
  • 1
  • 12
  • 31