Hi Walter,
in my Graphmodel I have several Nodes which are databound to SQL-Server / Entity-Data-Model- classes (Silverlight). The database records are in a 1:n self-relation with the same table. According to this, I got a Navigation-property in my Data-Class called Condition1.
Here’s the definition for my model:
model.NodeKeyPath = "PK_Condition"; model.ToNodesPath = "";
The nodes are shown in the diagram as expected, all Values are displayed as expected. But if I try to link my nodes via mouse I always got the error that I should override InsertToNodeKey what I did. You can see actual code down below. I still get an exception in the call: base.InsertToNodeKey! If I omit this line the link is removed from my diagram?! I didn’t find anything helpful in the documentation or the forum. I believe my fault is coming out of the missing ToNodesKeyPath. But if I set this to my readonly Navigation property this doesn’t work either. Could You please help me?
public class WessyGraphModel : GraphModel { protected override void InsertToNodeKey(Condition nodedata, Guid tokey) { var toNode = FindNodeByKey(tokey) as BDF.Wessy.Models.Condition; BDF.Wessy.Models.Condition fromCondition = nodedata as BDF.Wessy.Models.Condition; // add the linked node to the navigation-properties node list fromCondition.Condition1.Add(toNode); base.InsertToNodeKey(nodedata, tokey); }