I'm trying to set a WrapPanel as DropTarget using the following approach:
// Setup Drop TargetDropTarget dropTarget = new DropTarget();dropTarget.IsDropTarget = true;dropTarget.DropChannels.Add("ChannelA");DragDropManager.SetDropTarget(tabsContentPanel, dropTarget);
where "tabsContentPanel" is a WrapPanel.
This approach works on a ListBox and also on XamTree items contained in the WrapPanel. But when I set it on the WrapPanel, it doesn't allow dropping to the blank area of the WrapPanel.
Need help in setting the unoccupied area of a WrapPanel as a DropTarget!
Hi,
Make sure that you have Background set on the wrappanel (or at least Background="Transparent"), otherwise mouse events won't be fired. You can read more about this here.
I hope that this will help you.
Hi Nikolay,
Yes, I remember reading about that and, consequently, I set the Background="White". That didn't seem to make any difference.
Thank you for your prompt response. Please let me know anymore ideas you may have.
WrapPanel problem solved. I had inadvertently set the Background property on the wrong WrapPanel.
Thanks a million for your time, example and help working through this!
Please disregard the previous post. Problem running your example resolved. There was a button on the General Tab of the file properties window labeled "UnBlock". Clicking that button released the file.
Thanks!
Having some difficulty with running your example.
When I tried to load the designer for Shell.xaml I got a FileLoadException on the Toolkit file. The file is in place in your Dependencies folder and it appears normal in the VS Solution Explorer References folder. One thing I thought was kind of peculiar is that when I select the file in References and look at properties the Version shows 4.0.5.0 as does the error message. But, when I right click on the actual file and look at properties, the version shows as 4.0.40412,2000. I don't know whether this is pertinent or not, but thought I'd point it out just in case. Please refer to the attached snapshots of the beginning and end of the error message.
Could you check the attached sample? I was not able to reproduce the behaviour that you describe. Would it be possible to attach a simplified sample application that reproduces the issue (You can attach a file from the Options tab of the posting page or using the Media button) ?
Thank you