My diagram always set the first node in the Location of (0,0) although I set positions for all the nodes.
That depends on the values of various Diagram or DiagramPanel properties. I suggest you read the section “Initial Positioning and Scaling” in the GoXamIntro.pdf file, or at Content Alignment and Stretch and Initial Positioning and Scaling.
Thanks walter.
(I assume you realize you have some typos in the attribute names.)
That’s probably because you don’t have a large enough DiagramPanel.DiagramBounds to cover the whole DiagramPanel’s viewport when the Diagram.InitialPosition is (0,0).
You could just set the DiagramPanel.FixedBounds to a larger value. But this might be inconvenient if the diagram is supposed to automatically grow and shrink.
Or you could set the Diagram.Padding to a bigger value.
Do all DiagramPanel manipulation in a Diagram.TemplateApplied event handler. It’s called when the Diagram.Template has been expanded at which time there should be a DiagramPanel within the visual tree.