Answer the question
In order to leave comments, you need to log in
How to track pressed key in mvvm?
I have a Textbox which is used as a search engine. I need to apply the search by pressing the Enter key, not reacting to pressing other keys. If I didn’t do it through mvvm, I could use the KeyEventArgs parameter (it seems to be). And how do I track the key pressed using the mvvm approach?
Answer the question
In order to leave comments, you need to log in
Use KeyBinding :
<TextBox.InputBindings>
<KeyBinding Key="Enter" Command="{Binding SearchCommand}" />
</TextBox.InputBindings>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question