我目前正在將窗體應用程序移植到wpf。有一個包含文件名的列表框。應該可以將(多個)項目拖到Windows資源管理器中。 這很容易與舊的Windows窗體,但我無法找到一種方式如何可以在wpf中完成。列表框拖動在wpf
這是我使用Windows窗體使用的代碼:
void listView1_ItemDrag(object sender, ItemDragEventArgs e)
{
string[] files = GetSelection();
if (files != null)
{
DoDragDrop(new DataObject(DataFormats.FileDrop, files), DragDropEffects.Copy);
}
}
多重選擇是沒有問題的,代碼obove顯示我的方式我已經做了拖放在WIN窗體中,我想知道這是如何與WPF工作 – hans 2010-02-23 11:37:04