Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic DestinationAnchorChanged (Read 2846 times)
Plamen Boev
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 7
Joined: Jul 28th, 2014
DestinationAnchorChanged
Aug 4th, 2014 at 3:21pm
Print Post  
Hi,

when a diagram link changes it's destination anchor AND it's destination node at the same time and the DestinationAnchorChanged event rises - the e.Link.Destination of the link still points to the Destination node BEFORE the anchor has been changed and I can't find any other way to get the new Destination node at this moment. We are syncing the diagram changes with a database and handling this event in the database the id of the previous node is being saved.

Other than that in 1 out of 10 cases of a link changing the destination node the  DestinationAnchorChanged event DOES NOT raise. I could not find out why.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DestinationAnchorChanged
Reply #1 - Aug 4th, 2014 at 4:11pm
Print Post  
Hi,

This event is raised only if the DestinationAnchor value actually changes, and since the value is an integer index, it won't fire if you move to a point of a different node with the same anchor index. For better results handle LinkModified, then both the origin/destination node and anchor values should be up to date:

Code
Select All
private void diagram_LinkModified(object sender, LinkEventArgs e)
{
	if (e.AdjustmentHandle == 0)
	{
		// first point moved
		Debug.WriteLine(e.Link.OriginAnchor);
	}

	if (e.AdjustmentHandle == e.Link.ControlPoints.Count - 1)
	{
		// last point moved
		Debug.WriteLine(e.Link.DestinationAnchor);
	}
} 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Plamen Boev
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 7
Joined: Jul 28th, 2014
Re: DestinationAnchorChanged
Reply #2 - Aug 4th, 2014 at 8:35pm
Print Post  
Thank you, that solved the problem!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint