WPF: Is ListBox or Panel responsible for mouse wheel navigation?

Posted by HDW on Stack Overflow See other posts from Stack Overflow or by HDW
Published on 2009-03-17T09:19:51Z Indexed on 2010/04/12 1:03 UTC
Read the original article Hit count: 382

Filed under:
|
|
|
|

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)?

© Stack Overflow or respective owner

Related posts about wpf

Related posts about mouse