thank you for your answer , i succeeded in this taks !
however ,and this problem is even before my change, im finding it difficult to understand why the line suddenly breaks on several places (and not
in one place like i managed to do with your help) , if i change the linktemplate in runtime .
see , i need to show the diagram with different template (colors , behavior) sometimes , and that is y i need the template to swich on a user command .
i managed to realise that the template changing itself forces a complete re-calculation in the Route class. i also noticed that the line starts breaking in odd places when it crosses one another it breaks like in two places instead of one and not on the point returned from the
GetMidOrthoPosition function .
i figured it has to do with ComputeCurviness function that is called independently throghout the route.cs code so i’ve overriden it as follows:
protected virtual double ComputeCurviness()
{
return MiddleOrthogonalPoint;
}
while MiddleOrthogonalPoint is a new class property which is the result of my new calculations in
GetMidOrthoPosition as follows :
protected virtual double GetMidOrthoPosition(double fromPosition, double toPosition, bool vertical)
{
double routeLength = Math.Abs(fromPosition - toPosition);
MiddleOrthogonalPoint =(fromPosition + toPosition) / 2 + (routeLength * 0.4);
return MiddleOrthogonalPoint;
}
private double MiddleOrthogonalPoint {get;set;}
still no luck , a linktemplate change messes my links mid point and draws the link differently.
route.cs is very complicated and full of algorithms which some of the code is only calculated on some conditions , lots of if else that preety much makes me mixed up about the purpose of a function. any way you can direct me to the cause of this link behavior ?
thank you ,
Leo