Hi,
In ForceDirectedLayout, I want to control one node’s location. First I override IsFixed method to fix that node. Then I use the typical
go:Node.Location ="{Binding Data.Location, Mode=TwoWay}"
to bind the location to my model. I also set both HorizontalContentAlignment and
VerticalContentAlignment on the diagram to Stretch to avoid any auto adjustment.
So when I change the node’s location in code (say 0,0) , the diagram moves properly. So far so good. Now I enlarge the window and reset the node to (0,0). I expect that node will move the new center of the window. Instead, it stays where it was.
How can I accomplish that?
BTW, I don’t set HorizontalContentAlignment and VerticalContentAlignment to Center because I don’t like the sudden shift effect of the diagram after layout is finished. I implement my own animation to place the my model root at the center, which is not exactly the same as “Center” but it’s good enough for me.
Thanks.