From f4929c38abd1389377d30fca6c9304d2d6639d30 Mon Sep 17 00:00:00 2001 From: Victoria Plitt Date: Thu, 16 Dec 2021 15:27:38 +0200 Subject: Undo/Redo Length of segment. --- .../Tango.Touch/Controls/TouchNumericTextBox.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs') diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs index ad185f1a3..224f2d25b 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchNumericTextBox.cs @@ -33,6 +33,20 @@ namespace Tango.Touch.Controls remove { RemoveHandler(ValueChangedEvent, value); } } + public static readonly RoutedEvent ValueChangedEndEvent = EventManager.RegisterRoutedEvent("ValueChangedEnd", RoutingStrategy.Bubble, typeof(DoubleValueChangedEventHandler), typeof(TouchNumericTextBox)); + public event DoubleValueChangedEventHandler ValueChangedEnd + { + add { AddHandler(ValueChangedEndEvent, value); } + remove { RemoveHandler(ValueChangedEndEvent, value); } + } + + public static readonly RoutedEvent TextGotFocusEvent = EventManager.RegisterRoutedEvent("TextGotFocus", RoutingStrategy.Bubble, typeof(DoubleValueChangedEventHandler), typeof(TouchNumericTextBox)); + public event DoubleValueChangedEventHandler TextGotFocus + { + add { AddHandler(TextGotFocusEvent, value); } + remove { RemoveHandler(TextGotFocusEvent, value); } + } + public double Value { get { return (double)GetValue(ValueProperty); } @@ -155,6 +169,8 @@ namespace Tango.Touch.Controls { _text_box.CaretIndex = _text_box.Text.Length; } + DoubleValueChangedEventArgs args = new DoubleValueChangedEventArgs(TextGotFocusEvent, this, Value); + RaiseEvent(args); } private object CoerceValue(DependencyObject d, object e) @@ -205,6 +221,9 @@ namespace Tango.Touch.Controls DoubleValueChangedEventArgs args = new DoubleValueChangedEventArgs(ValueChangedEvent, this, Value); RaiseEvent(args); + + DoubleValueChangedEventArgs args2 = new DoubleValueChangedEventArgs(ValueChangedEndEvent, this, Value); + RaiseEvent(args2); } private void _text_box_PreviewKeyDown(object sender, KeyEventArgs e) -- cgit v1.3.1