diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-09 12:44:59 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-07-09 12:44:59 +0300 |
| commit | ca96477441518c8300474a317e34cb5e7e1550fc (patch) | |
| tree | 29c1aa30faab7fc4c74e57f519c93de83e70cf92 /Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs | |
| parent | 36d1edb4f9cc4fbd9c134d3b387bcfec05424537 (diff) | |
| download | Tango-ca96477441518c8300474a317e34cb5e7e1550fc.tar.gz Tango-ca96477441518c8300474a317e34cb5e7e1550fc.zip | |
PPC Performance improvements.
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs')
| -rw-r--r-- | Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs index 50c478acc..c45701e99 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs @@ -25,6 +25,13 @@ namespace Tango.Touch.Controls Regex regex_integer = new Regex(@"^[0-9]*(?:[0-9]*)?$"); Regex regex_double = new Regex(@"^[0-9]*(?:\.[0-9]*)?$"); + public static readonly RoutedEvent ValueChangedEvent = EventManager.RegisterRoutedEvent("ValueChanged", RoutingStrategy.Bubble, typeof(DoubleValueChangedEventHandler), typeof(TouchNumericTextBox)); + public event DoubleValueChangedEventHandler ValueChanged + { + add { AddHandler(ValueChangedEvent, value); } + remove { RemoveHandler(ValueChangedEvent, value); } + } + public double Value { get { return (double)GetValue(ValueProperty); } @@ -167,17 +174,16 @@ namespace Tango.Touch.Controls { if (_text_box != null && !_prevent_text_change) { - _text_box.Text = Value.ToString(); - if (StringFormat != null) { - _text_block.Text = Value.ToString(StringFormat); _text_box.Text = Value.ToString(StringFormat); } else { - _text_block.Text = Value.ToString(); + _text_box.Text = Value.ToString(); } + + _text_block.Text = _text_box.Text; } if (Value != _lastValue) @@ -190,6 +196,9 @@ namespace Tango.Touch.Controls } _lastValue = Value; + + DoubleValueChangedEventArgs args = new DoubleValueChangedEventArgs(ValueChangedEvent, this, Value); + RaiseEvent(args); } } |
