I have some nodes on a diagram and a print preview command. On click of print preview button I display the print grid using following event handler.
this.Diagram.Panel.DiagramBoundsChanged += (s, e) => UpdatePrintGrid();
When I click on the print preview button for the first time the print preview is correct, it is as shown in the below image FirstPreview.png
Now when I move any node when print preview is on, the diagram bounds change and diagram adds one more page. There is a big difference between the diagram.Panel.DiagramBounds, even though the node is moved slightly and not beyond the page borders. I have a refresh command where I recreate entire diagram. As a user I need to refresh entire diagram every time I move any node.
To avoid this how do I get correct bound so that print preview is proper?