We are using “Diagram” Object to illustrate Family relationship model.
A Node is a family member, and a Link is connection between Family members.
For a Node, We have created class “baseNodaData” that extends class GraphLinksModelNodeData<String>.
This class have the properties as follows:
string Picture .
Then, we have created class “MyNodeData” that extends our “baseNodaData” class, with it’s own properties (like “ChildPicture”).
Then. We have created a “Pallete” object, that shows all the nodes available and managed to drag them to the Diagram. each node is a “MyNodeDate” instance.
Everything worked Fine! we saw the node picture and caption and the child picture on every Node in the pallete and in the diagram.
Now, we wanted to remove the pallete from our Product, instead, we want to create nodes on the Diagram directly. that mean, from view model create new instance of “MyNodeData” and give it default values (exactly as we did at the pallete). and show it on the diagram.
The problem that it’s doesn’t show the picture or the caption. and instead, on the diagram we see the line “PartManager.PartBinding of Node to 4355-35556566-1231…” i thought it’s some binding problem (we are working with MVVM pattern), but i couldn’t see any problem, more than that, we didn’t changed anything. the only change is creating the myNodeData object directly on the Diagram instead of dragging it from the pallete… what can cause that problem??
the code to show it on the diagram is:
DiagramModel.AddNode(element); //element is “MyNodeData” instance.Mydiagram.Model = DiagramModel;