WPF TextBox KeyDown inheritance not starting in space?

I have a class that inherits a wpf text field, and now I have overridden OnTextChanged, OnTextInput, OnKeyDown for the funny part.

If I press any thing but Space , all three events fire, but if I press space , only OnTextChanged is fired? so why is space not considered key or text?

+3
source share
1 answer

You must handle the event PreviewKeyDown, since the default space is processed and therefore consumed by the framework.

+7
source

Source: https://habr.com/ru/post/1789021/


All Articles