如何用MVVM方式实现单项DragDrop WPF Listview?

时间:2021-09-20 14:26:57

I have two listviews (and Gridview inside that) inmy WPF/MVVM application. How would I implement Drag/Drop for single item in this case?

在我的WPF / MVVM应用程序中有两个listview(以及其中的Gridview)。在这种情况下,如何为单个项目实施拖放操作?

Any help would be appreciated. Thanks

任何帮助,将不胜感激。谢谢

2 个解决方案

#1


10  

I have made a sample application where you can have an idea about how it works with the MVVM i have ItemsControl ListView and another Listview Where you can drag and drop single item. you can find it here a project named DragDropItems Credit Bea Stollnitz's

我已经制作了一个示例应用程序,您可以在其中了解它如何与MVVM一起工作,我有ItemsControl ListView和另一个Listview,您可以拖放单个项目。你可以在这里找到一个名为DragDropItems Credit Bea Stollnitz的项目

#2


3  

Usually for DragDrop I use the code found at Bea Stollnitz's Blog. It's simple, easy to understand, and easy to modify as needed.

通常对于DragDrop我使用Bea Stollnitz博客中的代码。它简单易懂,易于根据需要进行修改。

#1


10  

I have made a sample application where you can have an idea about how it works with the MVVM i have ItemsControl ListView and another Listview Where you can drag and drop single item. you can find it here a project named DragDropItems Credit Bea Stollnitz's

我已经制作了一个示例应用程序,您可以在其中了解它如何与MVVM一起工作,我有ItemsControl ListView和另一个Listview,您可以拖放单个项目。你可以在这里找到一个名为DragDropItems Credit Bea Stollnitz的项目

#2


3  

Usually for DragDrop I use the code found at Bea Stollnitz's Blog. It's simple, easy to understand, and easy to modify as needed.

通常对于DragDrop我使用Bea Stollnitz博客中的代码。它简单易懂,易于根据需要进行修改。