Get the item doubleclick event of listview

后端 未结 16 1481
没有蜡笔的小新
没有蜡笔的小新 2020-12-01 02:17

What do I need to do in order to reference the double click event for a listview control?

16条回答
  •  一个人的身影
    2020-12-01 02:45

    It's annoying, but the best way to do it is something like:

    
        
            
        
    
    

    Then in the code:

    public void HookLVIClicked(object sender, RoutedEventArgs e) {
        var fe = (FrameworkElement)sender;
        var lvi = (ListViewItem)fe.Tag;
        lvi.MouseDoubleClick += MyMouseDoubleClickHandler;
    } 
    

提交回复
热议问题