Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Up/down key bindings not recognized

I have a textbox and a listbox. The listbox shows search suggestions for the textbox. I want to highlight the first listbox item when user presses down arrow when the textbox is focused. Similarly, the textbox should be focused back when the user is as the first element on the listbox and presses the up arrow.

I am using 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 one doesn't work at all (the associated event isn't fired).

Any suggestions?

like image 595
Sayak Banerjee Avatar asked Nov 14 '22 09:11

Sayak Banerjee


1 Answers

The events associated with ListBox up and down have priority. I ended up using shift up/down instead because there are so many event consumers that use the up and down events.

like image 59
Joe Sonderegger Avatar answered Dec 12 '22 08:12

Joe Sonderegger