WPF: Is ListBox or Panel responsible for mouse wheel navigation?
- by HDW
I have a custom ListBox which uses a custom Panel as ItemsHost. I want to have control over mouse wheel input, so that turning the wheel changes the single selected item.
I believe that the best method to do so is to handle the OnPreviewMouseWheel event (although this is only have what I want since it doesn't provide horizontal wheel data).
Now the big question: Is there a best practice where to handle OnPreviewMouseWheel? In ListBox (which by default doesn't have a clue about the arrangement of the Panel's child elements) or in Panel (which by default doesn't have a clue about the "IsSelected" property of it's child elements)?