Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Link Style (Read 4429 times)
toto22
YaBB Newbies
*
Offline



Posts: 6
Joined: Nov 19th, 2008
Link Style
Nov 21st, 2008 at 4:41pm
Print Post  
hi ,
I have a link where the link style is set to polyline and the number of segments are set to 4.

I arranged some of the segments manually, Now when i have to change the destination of this link all the arrangment is lost and the link becomes a Straight line.

How can i retain the arrangments of the different segments when the destination is changed?
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link Style
Reply #1 - Nov 21st, 2008 at 6:51pm
Print Post  
This could happen if AutoRoute is enabled. You might disable it, or check if some bit in RoutingOptions.TriggerRerouting will prevent the link from re-routing in this case.

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



Posts: 6
Joined: Nov 19th, 2008
Re: Link Style
Reply #2 - Nov 24th, 2008 at 1:43pm
Print Post  
Hi Stoyan,
I have set AutoRoute to false and also tried setting TriggerRerouting = MindFusion.Diagramming.Wpf.RerouteLinks.Never but still the same problem.
as soon as i change the destination of the link the link arrangments are lost and the line connecting the two nodes becomes a Straight line.
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link Style
Reply #3 - Nov 24th, 2008 at 2:53pm
Print Post  
Hi,

Are you handling the LinkModified event?

  
Back to top
 
IP Logged
 
toto22
YaBB Newbies
*
Offline



Posts: 6
Joined: Nov 19th, 2008
Re: Link Style
Reply #4 - Nov 24th, 2008 at 3:14pm
Print Post  
I have a link which is already attached to a shape and when the user selects this shape and drags it to another shape on the diagram I am performing some calculation and at that time i needed to remove the link association with the selected node (shape) and associate the link with the node on which the selected node was dropped.
Everything is working fine; the only problem is the line style. The line style is lost.

Yes I am handling LinkModified Event but in this case I get NodeModified event where I am setting the Destination property of the link to the node on which the selected node was dropped.
  
Back to top
 
IP Logged
 
toto22
YaBB Newbies
*
Offline



Posts: 6
Joined: Nov 19th, 2008
Re: Link Style
Reply #5 - Nov 24th, 2008 at 5:24pm
Print Post  
ok for now this seems to work.
If you have a better solution please do let me know.

int pointCount = eLink.ControlPoints.Count;
wpfMindFusion.PointCollection points = new MindFusion.Diagramming.Wpf.PointCollection(pointCount);
for (int i = 0; i < pointCount; i++)
{
points[i] = new Point(eLink.ControlPoints[i].X, eLink.ControlPoints[i].Y);
}
eLink.Destination = nNode;
for (int i = 0; i < pointCount-1; i++)
{
eLink.ControlPoints[i] = points[i];
}
eLink.UpdateFromPoints();
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link Style
Reply #6 - Nov 25th, 2008 at 7:06am
Print Post  
I thought you were changing the destination interactively - it's only in this case when the shape is preserved. If you change it from code, you will have to save the old SegmentCount and ControlPoints values, and restore them afterwards.

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