在Silverlight列表框中,如何接收从其他列表框中拖动的所有属性 [英] In silverlight listbox how to receive all the properties dragged from other listbox

查看:69
本文介绍了在Silverlight列表框中,如何接收从其他列表框中拖动的所有属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Person类,它包含三个属性,分别是名称,年龄,地址.还有三个列表框,分别显示这三个属性.此外,另一个ListboxDragDropTarget用于接收从这三个列表框中拖动的项目然后形成一个完整的人物对象.我遇到的是我使用了以下
text = {绑定名称}
文字= {装订年龄}
text = {绑定地址}

但是,当我从三个列表框之一中拖动一个项目时,目标列表框仅接收整个person属性,而不仅仅是我拖动的单个项目.有什么好主意可以解决我的问题吗?

I have a class Person ,which contains three properties ,they are name,age,address.And I have three listbox to display these three properties separately .In addition ,another ListboxDragDropTarget was used to receive the items dragged from these three listbox and then to form a complete person object. What I have encountered was that I used the following
text={Binding name}
text={Binding age}
text={Binding address}

but when I dragged an item from one of the three listbox ,the target listbox just simply receive the whole person property ,which was not just the single item I dragged. Any good ideas to solve my questions?

推荐答案

列表框没有列.您可以在WPF(Silverlight是)中设置您喜欢的对象的任何渲染,但是拖放操作将始终删除整个对象.除非您能对拖曳的开始点和在那里呈现的内容做一些丑陋的工作,否则您可能会发现需要使用带有
A listbox does not have columns. You can in WPF ( which Silverlight is ) set up any rendering of an object you like, but drag and drop will always drop the entire object. Unless you can do some ugly work with working out the point where the drag started and what was rendered there, you may find you need to use a control with columns like a Grid[^]. I''m not sure how drag and drop works between grids, but, if you need to know the column, then a control with actual columns is your only real hope.


这篇关于在Silverlight列表框中,如何接收从其他列表框中拖动的所有属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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