如何做到将两表之间在WPF下降? [英] How to do Drag and Drop in WPF between two lists?

查看:152
本文介绍了如何做到将两表之间在WPF下降?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个很难解决我的问题,我从字面上去疯了。

I'm having a hard time solving an issue of mine, I'm literally going mad.

这里的想法:我有两个的ListView 元素,而我需要在一个元素从第一个列表到第二滴开始对话,但我需要两个从该元件的信息被丢弃而被添加的元素来填充对话

Here's the idea: I have two ListView elements, and I need to open a dialogue when an element drops from the first list onto the second, but I need both the information from the element being dropped and the element being added to fill in the dialogue.

问题是,我甚至不能得到基本的功能正确的 - 那就是在开幕下降对话

The thing is, I can't even get the basic functionality right - and that is opening the dialogue on drop.

我要学D&放大器;ð技术从开始到结束,但我很快就需要一种方式来至少调用对话

I'm going to learn the D&D technique from start to finish, but I quickly need a way to at least call the dialogue.

写入和擦除一些code我已经离开的唯一的事情后如下:

After writing and erasing some code the only thing I have left is the following:

    private void lvListaRadnika_MouseDown(object sender, MouseButtonEventArgs e)
    {
        DragDrop.DoDragDrop(lvListaRadnika, presenter.Selected, DragDropEffects.None);
    }

    private void ListView_Drop(object sender, DragEventArgs e)
    {
        DodavanjeRezervacije dr = new DodavanjeRezervacije(new DodavanjeRezervacijePresenter(null,true));
        dr.Show();
    }

在这一点上,我需要一些事情发生之后,我会看到有关添加所有必要的检查,饲养与数据的对话,以及添加装饰器。

At this point I need something to happen and after that I'll see about adding all the necessary checks, feeding the dialogue with the data as well as adding an adorner.

如果有人可以解释尽可能多的关于拖放一路上我会强烈AP preciate,但在这一点上,我只真的需要这个火起来。

If someone could explain as much as possible about drag and drop along the way I would highly appreciate it, but at this point I only really need this to fire up.

推荐答案

我的意见转换成回答:

您真的应该给一个尝试到龚WPF拖放框架。我可以帮助做这类事情在一个非常干净,漂亮(MVVM)的方式。

You should really give a try to the Gong WPF Drag And Drop Framework. I helps do these kind of things in a really clean and nice (MVVM) way.

这篇关于如何做到将两表之间在WPF下降?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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