Grid layout, Item collapse are no more aligned

When I collapse a group it’s no more aligned on the Grid.

Before collapsing:

After collapsing:

As in your example I use property gowpf:Group.IsSubGraphExpanded={Binding Data.ViewModel.IsExpanded, Mode=TwoWay}"

Positioning is calculate by default DoLayout method.

I think you need to have the Diagram.Layout be an instance of GridLayout. That way as nodes change size the layout will automatically be performed again.

Another reason for that behavior is that I think you have set the Node.LocationSpot to be Spot.Center on your Group template. But if you need that behavior for other reasons, then using an automatic layout is the best solution.