Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/338.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 将ListView设置为Windows 10通用应用程序上文件的删除目标_C#_Drag And Drop_Win Universal App - Fatal编程技术网

C# 将ListView设置为Windows 10通用应用程序上文件的删除目标

C# 将ListView设置为Windows 10通用应用程序上文件的删除目标,c#,drag-and-drop,win-universal-app,C#,Drag And Drop,Win Universal App,我在XAML中声明了以下元素: <ListView Name='mPlaylist' AllowDrop='True' DragEnter='HandlePlaylist_DragEnter' Drop='HandlePlaylist_Drop' /> 当我使用鼠标将文件从Windows资源管理器或桌面拖到我的ListView上时,会执行DragEnter处理程序,我可以将DragEventArgs的AcceptedOperation成员设置为Link(并将Handled设置为

我在XAML中声明了以下元素:

<ListView Name='mPlaylist' AllowDrop='True' DragEnter='HandlePlaylist_DragEnter' Drop='HandlePlaylist_Drop' />

当我使用鼠标将文件从Windows资源管理器或桌面拖到我的ListView上时,会执行DragEnter处理程序,我可以将DragEventArgs的AcceptedOperation成员设置为Link(并将Handled设置为true)。到目前为止,一切顺利

当我释放左键单击时,Drop事件处理程序永远不会被触发。我不明白为什么不

当我将文件拖到ListView上时,光标会变为停止/无效光标,并且文件缩略图会覆盖一个红十字(尽管我将AcceptedOperation设置为与RequestedOperations-Link之一匹配)

虽然可能不相关,但缩略图也会向上跳到左侧,距离光标相当远。将光标移动到ListView和缩略图上并不能与光标保持恒定的距离-我也无法理解这一点

我在电脑上工作,在VS2015 RC中使用10.0.10069.0版的通用应用程序平台


我非常感谢任何关于如何在我的ListView上触发Drop事件的想法(甚至可能修复缩略图在ListView上与光标“分离”的视觉故障)。

解决方案是使用DragOver事件设置DragEventArgs的AcceptedOperation成员,而不是拖拉剂

感谢Igor Ralic将解决方案发布在他的网站上