通过拖放事件来定位ScatterViewItem [英] Target ScatterViewItem by a Drag&Drop Event

查看:64
本文介绍了通过拖放事件来定位ScatterViewItem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下示例:

http://msdn.microsoft.com/en-us/library/ff727721.aspx

http://msdn.microsoft.com/en-us/library/ff727721.aspx

如何获取目标ScatterViewItem?

How can I get the target ScatterViewItem?

我想使用Drag& Drop事件将两个ScatterViewItems与一条线连接起来。

所以当我将一个ScatterViewItem删除到另一个我必须得到目标项的字段。

I want to use the Drag&Drop event to connect two ScatterViewItems with a line.
So when I drop one ScatterViewItem to another I must get a field of the target item.

private void OnDrop(object sender, SurfaceDragDropEventArgs e)
{
    TestViewModel sourceTest = e.Cursor.Data as TestViewModel;
    sourcetask.Parent = firstElement;
}




目前我有一个元素的引用(firstElement)。但是我将在这一点上而不是firstElement这个drop事件的目标元素。我怎么才能得到它?


In the moment I have a reference to one element (firstElement). But I will at this point instead of the firstElement the target element of this drop event. How can I get it?

推荐答案

Ok我明白了。

Ok I get it.

这与draggedElement的方式相同。

It is the same way like the way for the draggedElement.


这篇关于通过拖放事件来定位ScatterViewItem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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