How to capture a mouse click on an Item in a ListBox in WPF?

前端 未结 6 1367
长情又很酷
长情又很酷 2020-12-02 11:30

I want to get notified when an item in a ListBox gets clicked by the mouse, whether it is already selected or not.

I searched and found this: (http://kevin-berridge.

6条回答
  •  眼角桃花
    2020-12-02 12:00

    I think the first option in Andy's answer, of using PreviewMouseLeftButtonDown, is the way to go about this. In XAML it would look like this:

    
        
            
        
    
    

提交回复
热议问题