Get the item doubleclick event of listview

后端 未结 16 1419
没有蜡笔的小新
没有蜡笔的小新 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:52

    Was having a similar issue with a ListBox wanting to open a window (Different View) with the SelectedItem as the context (in my case, so I can edit it).

    The three options I've found are: 1. Code Behind 2. Using Attached Behaviors 3. Using Blend's i:Interaction and EventToCommand using MVVM-Light.

    I went with the 3rd option, and it looks something along these lines:

    
    
    
        
        
    
    

    That's about it ... when you double click on the item you want, your method on the ViewModel will be called with the SelectedItem as parameter, and you can do whatever you want there :)

提交回复
热议问题