diff options
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs index 09b5e8f96..50c478acc 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs @@ -21,6 +21,7 @@ namespace Tango.Touch.Controls private TextBox _text_box; private bool _prevent_text_change; private TextBlock _text_block; + private double _lastValue; Regex regex_integer = new Regex(@"^[0-9]*(?:[0-9]*)?$"); Regex regex_double = new Regex(@"^[0-9]*(?:\.[0-9]*)?$"); @@ -179,10 +180,16 @@ namespace Tango.Touch.Controls } } - BindingExpression b = GetBindingExpression(ValueProperty); - if (b != null) + if (Value != _lastValue) { - b.UpdateSource(); + BindingExpression b = GetBindingExpression(ValueProperty); + + if (b != null) + { + b.UpdateSource(); + } + + _lastValue = Value; } } |
