Diagram.SnapToGrid Property
If true, shapes on the diagram are adjusted to align with a grid when they are moved by the user. Default value is true.
Assembly: Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0.dll)
When snap-to-grid is turned on, shapes are automatically aligned as the user move them on the diagram. The X and Y values of the positions are set to multiples of their GridSize.
If you do not want any shapes in your diagram to be aligned to a grid, override this property to return false. If you want alignment only for some shapes, leave this property true, and override the GridSize to return 0.0 for those ShapeElements that you want to be unaligned.
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.