aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-07-08 09:45:46 +0300
committerShlomo Hecht <shlomo@twine-s.com>2018-07-08 09:45:46 +0300
commita2cf6c8d62083a63ee193a1cd206ab345368b242 (patch)
tree4f653018e4fb5b4ad806e9d410800489afe411e5 /Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs
parentc8807df7010acb129997cb7ca130e6b7928ce809 (diff)
parentf4688d6113dc33deac114bd6999967fec246b8c0 (diff)
downloadTango-a2cf6c8d62083a63ee193a1cd206ab345368b242.tar.gz
Tango-a2cf6c8d62083a63ee193a1cd206ab345368b242.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/Tango/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs')
-rw-r--r--Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs13
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;
}
}