简体   繁体   English

是否可以在其他应用程序(如UWP C#中的记事本)之间从ListView拖放数据(字符串)

[英]Is it possible to drag and drop data (String) from a ListView between other apps like Notepad in UWP C#

Is it possible to drag and drop data (String) from a ListView between other apps like Notepad. 是否可以在记事本等其他应用之间从ListView拖放数据(字符串)。 I know you can drag and drop files but I want to know if dragging and droping an ListViewItem that Contains the string I want to share between apps, Like for example if I'm sharing a string it would make sense if it is dropped into a app containing a text field or anything that allows such data. 我知道您可以拖放文件,但是我想知道是否拖放包含要在应用程序之间共享的字符串的ListViewItem,例如,例如,如果我共享一个字符串,将其拖放到包含文本字段或任何允许此类数据的内容的应用。

It is possible to drag-drop data between apps. 可以在应用程序之间拖放数据。 For this purpose you use DataPackage . 为此,可以使用DataPackage In one app you set the data , whereas in the second app, upon drop operation you get the data from DataPackageView with GetDataAsync method. 在一个应用程序中,您设置数据 ,而在第二个应用程序中,进行拖放操作时,您将使用GetDataAsync方法DataPackageView中获取数据

So everything depends what data is accepted by the drop target app and how it's being handled there. 因此,一切都取决于放置目标应用程序接受哪些数据以及在该处如何处理。

Once I've written small drag-drop sample - maybe you will find something usefull there. 一旦我写了一些小的拖放样本 -也许您会在这里找到有用的东西。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM