Node drag on X only

How can a node be restricted to move left and right (X axis) only and not be dragged up and down. Also this node should honour Grid snapping when moved left or right

Set or data-bind the go:Node.MinLocation and go:Node.MaxLocation attached properties on the root element of your node DataTemplate.

For example:
go:Node.MinLocation=“0 250” go:Node.MaxLocation=“9e9 250”
will restrict the Node.Location to have a positive X value and a Y value of 250.

For more sophisticated limits on moving a Node, override DraggingTool.ComputeMove.

The DraggingTool does respect whether Diagram.GridSnapEnabled is true. That’s controlled by DraggingTool.SnapTo, which is called by ComputeMove.

Can a Node’s MinLocation and MaxLocation be Databind to its Containing Group’s bounds so that it can only move within the group itself and can not be moved outside the bounds of containing group. Containing group itself is set to Movable and Sizeable false.

Also some help with XAML syntax to achieve this will be appreciated Smile

I suppose it would be possible with a Converter.

But I think it’s easier to just override DraggingTool.ComputeMove.
That would be much more efficient too.