timheuer / callisto

A control toolkit for Windows 8 XAML applications. Contains some UI controls to make it easier to create Windows UI style apps for the Windows Store in accordance with Windows UI guidelines.
http://timheuer.com/blog/archive/2012/05/31/introducing-callisto-a-xaml-toolkit-for-metro-apps.aspx
Other
338 stars 108 forks source link

Adding values to NumericUpdown Control #223

Open zakkar1 opened 11 years ago

zakkar1 commented 11 years ago

Hi Tim , I'm using the NumericUpDown Control in my C# XAML Store App. Great control by the way. I have bound the Text property of the control with a class and when my XAML opens I can successfully display the value. But I have a problem and I don't know how to handle it. Let's say that when the XAML opens the numeric control has already a value. Because it comes from a retrieve (SQlite database) the NumericUpDown control displays the data. If I press the plus or minus sign it starts from scratch. It removes the values that has already and start the increment from scratch. How can I handle this ? I have the below in my XAML

When the XAML loads it binds the size property. But if the size property has values when the user presses the plus sign it starts from scratch. If it has 20 it will not start from 20 plus 10 and displays 30 but it will display 10. Tried the textchanged , selectiochanged events but no luck. Instead i end up in a infinite loop by assigning dynamic the previous value plus 10 ... Any ideas on this? Appreciate any help you could give me.