# Want to binding the link amount between two nodes

Hi,

I want to binding the link amount between two nodes to the link.Rout.Curvness Property.
1 0
2 40
3 -40
4 80
5 -80
How can i do it???
I find if i set a value to curvness,then the first link will has a curvness too.
It is not well for us.

I’m sorry, but I don’t understand your question.

The default value for Route.Curviness is Double.NaN, which tells Route to calculate and use an appropriate value.

You can certainly data-bind that property to your own data property. Perhaps you want to default your property to NaN and use Mode=TwoWay data-binding?

I write a converter for a link,I binding to it’s “Curviness” Property.
the converter like following:
// Curviness increase unit
public const int CURVINESSBASS = 40;
public override object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
Northwoods.GoXam.PartManager.PartBinding pb = value as Northwoods.GoXam.PartManager.PartBinding;

// from the binding data i find FromNode and ToNode
// then caculator the linkamount between the two nodes
if (dia.Links.Any(one => (one.FromNode == fnode && one.ToNode == tnode) || (one.FromNode == tnode && one.ToNode == fnode)))
{
var t = dia.Links.Where(one => (one.FromNode == fnode && one.ToNode == tnode) || (one.FromNode == tnode && one.ToNode == fnode));
int count = t.Count();
if (count <= 1) return 0;
else
{
// caculator the Curviness by division and mod
int divisionResult = count / 2;
int mod = count % 2;
int curvNess = divisionResult * CURVINESSBASS;

// but it work not well following
if (mod == 0)
{
if (fnode.Bounds.X < tnode.Bounds.X)
{
return curvNess;
}
else
{
return -curvNess;
}
}
else
{
if (fnode.Bounds.X<tnode.Bounds.Y)
{
return -curvNess;
}
else
{
return curvNess;
}
}
}
}
else return 0;
}
}
the curvness value is decided by clockwise if it clockwise the value is a positive number the otherwise it is a negative number.
so i can’t control it Easily.
how can i do it??

I don’t know.

What is it about the default behavior that you don’t like?

Maybe you want to override Route.ComputeCurviness.