Hi,
I have a BoundDiagramLink derived from DiagramLink and I also set the diagram's Behavior to
public class DrawBoundLinksBehavior : DrawLinksBehavior
{
public DrawBoundLinksBehavior(Diagram diagram) : base(diagram) { }
protected override DiagramLink CreateLink()
{
return new BoundDiagramLink(Diagram);
}
}
in order to get my own BoundDiagramLinks.
I use the BoundDiagramLinks to separate the Link's data from the view and hold them in a model.
The model data is an additional Origin/DestinationID containing GuIDs that are stored in the MyNode classes Tag also.
The BoundDiagramLink also have the Origin/DestinationIndex which is already part of the DiagramLink class.
Let's only look at the OriginIndex in BoundDiagramLink:
public class BoundDiagramLink : DiagramLink
{
public static readonly DependencyProperty OriginIndexProperty = DependencyProperty.Register(
"OriginIndex",
typeof(int),
typeof(BoundDiagramLink),
new PropertyMetadata(""));
public BoundDiagramLink(Diagram parent) : base(parent) { }
public BoundDiagramLink(Diagram parent, DiagramNode origin, DiagramNode destination)
: base(parent, origin, destination)
{
}
}
When the BoundDiagramLink is created in my Behavior class I run in an exception
"Default value type does not match type of property: OriginIndex".
What am I doing wrong?
Regards,
Pontius