R
Robert
I am using WindowsFormsHost to host a Winforms control in a .NET 3.5 WPF
application. I can drag and drop a simple string from the Winforms control to
a WPF control.
However, when I pass a generic collection to the DoDragDrop() method of the
WinformsControl, the WPF control gets a return value of null from the
DragEventArgs.Data.GetData() method, even though I can see in the debugger
that DragEventArgs.Data contains data of the type of my generic collection.
What am I missing?
snippet from Winforms control:
private void ListViewItemDrag(object sender, ItemDragEventArgs e)
{
List<Dictionary<String, String>> list = //get data to drag from
control
DoDragDrop(list, DragDropEffects.Move);
....
snippet from drag destination wpf control:
public void TreeViewDrop(object sender, DragEventArgs e)
{
List<Dictionary<String, String>> list = (List<Dictionary<String,
String>>)e.Data.GetData(typeof(List<Dictionary<String, String>>));
//after this call, list is null even though Data seems to contain object of
desired typed.
Thanks,
Robert
application. I can drag and drop a simple string from the Winforms control to
a WPF control.
However, when I pass a generic collection to the DoDragDrop() method of the
WinformsControl, the WPF control gets a return value of null from the
DragEventArgs.Data.GetData() method, even though I can see in the debugger
that DragEventArgs.Data contains data of the type of my generic collection.
What am I missing?
snippet from Winforms control:
private void ListViewItemDrag(object sender, ItemDragEventArgs e)
{
List<Dictionary<String, String>> list = //get data to drag from
control
DoDragDrop(list, DragDropEffects.Move);
....
snippet from drag destination wpf control:
public void TreeViewDrop(object sender, DragEventArgs e)
{
List<Dictionary<String, String>> list = (List<Dictionary<String,
String>>)e.Data.GetData(typeof(List<Dictionary<String, String>>));
//after this call, list is null even though Data seems to contain object of
desired typed.
Thanks,
Robert