我使用DragDrop.DoDragDrop
将文件从我的C#WPF应用程序复制到Windows资源管理器。但是,实际复制文件会导致我的WPF应用程序冻结,直到复制完成。此复制操作可能会持续几秒到几分钟。如何使DragDrop.DoDragDrop异步?
DataObject dragdata = new DataObject(DataFormats.FileDrop);
System.Collections.Specialized.StringCollection sc = new System.Collections.Specialized.StringCollection();
//fill the StringCollection with filenames
dragdata.SetFileDropList(sc);
DragDrop.DoDragDrop(listviewitem, dragdata, DragDropEffects.Copy);
如何在不冻结/锁定我的应用程序的情况下调用DoDragDrop方法?我无法理解DataObject报告的“异步”实现。
你的应用程序在哪里冻结?你释放鼠标吗?如果您希望有人能够帮助您,请提供问题的回购问题:https://stackoverflow.com/help/mcve – mm8