Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Need Drag and Drop on nodes (Read 1145 times)
Anshul
Senior Member
****
Offline


I love YaBB 1G - SP1!

Posts: 316
Joined: Apr 3rd, 2009
Need Drag and Drop on nodes
Dec 3rd, 2009 at 9:03am
Print Post  
Hi Stoyan,

In one of our requirement we want behavior of link creation but we don't want to create a link i.e. if user start dragging from one node to another node, we want source node and destination node information on stop of dragging but we don’t want to create a link on it, instead it should show the path of dragging so that user can understand for which nodes operation will get perform. To do this we are thinking for DrawLinks behavior because by this we can get source and destination node information.

Is there any other way to do this drag and drop operation from one node to another such that it will give some impression to user that some operation is going on?
OR
Can we show a different style of link when it is in creating state i.e. just after setting DrawLinks behavior without modifying standard style of created links?

Please suggest.


Regards,
Anshul
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Need Drag and Drop on nodes
Reply #1 - Dec 3rd, 2009 at 11:42am
Print Post  
Hi,

You could change the link appearance from the InitializeLink handler:

Code
Select All
private void diagram_InitializeLink(object sender, LinkEventArgs e)
{
	if (diagram.Behavior == Behavior.DrawLinks)
	{
		// show path mode
		e.Link.Pen.DashStyle = DashStyles.Dash;
		e.Link.Pen.Brush = new SolidColorBrush(Color.FromArgb(50, 50, 50, 50));
		e.Link.HeadShape = ArrowHead.None;
	}
}

private void diagram_LinkCreating(object sender, LinkValidationEventArgs e)
{
	if (diagram.Behavior == Behavior.DrawLinks)
	{
		// show path mode
		if (Mouse.LeftButton == MouseButtonState.Released)
		{
			e.Cancel = true;
			var dragStarted = e.Origin;
			var dragEnded = e.Destination;
		}
	}
}
 



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