Diagram is centering

I am searching the function that is called and which changes my nodes position when I drop a new node or drag a new link…

I would like to avoid the graph to change when I am doing an action.

This behaviour doesn’t appear in your draggableLink or state chart samples… I can’t find what I have to change to avoid that…

When a new node or link is added to a diagram, the diagram automatically computes a new diagram bounds and then tries to meet the requirements of any Diagram.Stretch and HorizontalContentAlignment and VerticalContentAlignment. I don’t know what you have set, but you probably don’t want to set the first property, and the latter two properties you want to set to “Stretch” rather than “Center”.

I set my diagram like this :

<go:Diagram x:Name=“myDiagram” MouseLeftButtonUp=“Click_Panel”
NodeTemplateDictionary="{StaticResource NodeTemplateDictionary}"
LinkTemplateDictionary="{StaticResource LinkTemplateDictionary}"
Grid.Row=“1” Grid.Column=“1” Cursor=“Arrow” AllowClipboard=“True”
PanningTool="{x:Null}" Grid.RowSpan=“4”
GroupTemplate="{StaticResource GroupTemplate}"

I add the possibility to change my link route as in your link demo sample, but, in my diagram, my nodes all change of position when I change my link route…

Could it be linked to this?


It seems to be that, thx for your help :)