Up / down button keys not recognized

I have a text box and a list. The list displays the search suggestions for the text field. I want to highlight the first element of the list when the user presses the down arrow when the text box is focused. Similarly, the text box should be focused when the user is the first item in the list and presses the up arrow.

I use the following code for KeyBindings:

<KeyBinding Key="Down" Command="{x:Static local:SearchView.ApplicationShortCutsCommand}" CommandParameter="{x:Static common:SearchViewCommands.MoveToSuggestions}" /> <KeyBinding Key="Up" Command="{x:Static local:SearchView.ApplicationShortCutsCommand}" CommandParameter="{x:Static common:SearchViewCommands.MoveToQuery}" /> 

Other keys, such as Esc and Enter, work fine, although this file does not work at all (the associated event does not fire).

Any suggestions?

+4
source share
1 answer

Events related to the ListBox up and down take precedence. In the end, I used shift up / down, because there are so many event users who use the up and down events.

+1
source

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


All Articles