Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Disallow Drag and Drop Issue (Read 1069 times)
chris
Junior Member
**
Offline


I love YaBB 1G - SP1!

Posts: 57
Joined: Feb 1st, 2008
Disallow Drag and Drop Issue
Aug 20th, 2009 at 4:44pm
Print Post  
Hi Stoyan,

I have two windows with different Diagram controls. The problem is that I can drag Node from one palette of Window A and drop to Diagram control of Window B.

Even if I add Drag_Over event handler and wirte code like this
e.Effects = System.Windows.DragDropEffects.None

the tester can drop nodes to it sometimes when he drags and drops in an "intentional quick" way.

Do you have some suggestion about how to prevent dragging and dropping to Diagram form outside?

Thanks a lot!
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Disallow Drag and Drop Issue
Reply #1 - Aug 21st, 2009 at 11:58am
Print Post  
Hi,

You can stop the drop event from reaching the diagram by setting Handled - true in the preview event:

Code
Select All
private void diagram_OnPreviewDrop(object sender, DragEventArgs e)
{
	e.Handled = true;
}
 



DragEventArgs doesn't show where the drag operation started, so you must devise another way to determine that. E.g. you could handle PreviewMouseDown of the NodeListViews and keep tracks which is the last one the user clicked, or perhaps examine the DiagramNode set as e.Data and check if it's from an allowed type.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint