Get Notified BEFORE the Text in a Windows::UI::Xaml::Controls::TextBox Changes

101 views Asked by At

Is there any way to get notified BEFORE the text in a Windows::UI::Xaml::Controls::TextBox changes (TextChanged and TextChangedEventHandler work great to get notified AFTER the text changes)?

The functionality I am seeking would be loosely equivalent to iOS's shouldChangeCharactersInRange.

1

There are 1 answers

0
Filip Skakun On

You could store the previous Text value from the last TextChanged event in a field and if you are not happy with the new value on TextChanged - revert to the old value. Alternatively - you could indicate an error without actually preventing a value change.