So I have a window that handles the KeyDown event. Everything works as expected except under two conditions:
- The up / down arrow keys are pressed and
- A combo box on the window has more than one item.
Even if I’ve never clicked on the combo box it doesn’t seem to matter. The SelectionChanged event on the combobox fires before the Window even fires its KeyDown event. This seems highly counter-intuitive to me.
I don’t know enough about WPF event propagation to even know where to start looking for a solution. Any recommendations?
You should subscribe to
PreviewKeyDownevent instead.