[UWP] [C#] [XAML]从ListViewBase拖动项目 [英] [UWP][C#][XAML] Drag items from ListViewBase

查看:53
本文介绍了[UWP] [C#] [XAML]从ListViewBase拖动项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我有一个关于从ListViewBase拖放项目的问题。

Hi everyone, I have a question about dragging and dropping items from ListViewBase.

有没有办法在使用ListViewBase的DragItemsStarting事件时修改拖动UI?我的一些物品非常大,我想在拖动时让它们变小,只是它的一个小版本。是否有可能?

Is there a way to modify drag UI when using DragItemsStarting event of ListViewBase? Some of my items are pretty big and I'd like to have them smaller when dragging, just a small version of it. Is it possible?

另一个问题是: 是否可以拦截桌面的DraOver事件?当我需要将项目拖动到桌面时,我还会在拖动时修改UI和一些文本。 

And another issue is: is it possible to intercept DraOver event for Desktop? When I need to drag item to desktop I would also modify UI and some text while dragging. 

推荐答案

您好AvelN,

Hi AvelN,

欢迎来到开发通用Windows应用程序
论坛!

据我所知,无法修改拖动UI以使项目更小,但我们可以使用

DragUIOverride.SetContentFromBitmapImage
创建方法来自提供的BitmapImage的可视元素来表示dra在拖放操作中使用gged数据来实现UI自定义。

As far as I known, it is not possible to modify the drag UI to make the item to be smaller, but we can use DragUIOverride.SetContentFromBitmapImage methods to create a visual element from a provided BitmapImage to represent the dragged data in a drag-and-drop operation to implement the UI Customization.

有关详细信息,请尝试参考此官方示例中的Scenario2_DragUICustomization:XamlDragAndDrop

For more information, please try to refer to the Scenario2_DragUICustomization in this official sample:XamlDragAndDrop.

最好的问候,

Amy Peng

Best Regards,
Amy Peng


这篇关于[UWP] [C#] [XAML]从ListViewBase拖动项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆