This topic has not yet been rated - Rate this topic

Diagram.GridSize Property

Gets or sets the default grid size for the shapes on the diagram.

Namespace:  Microsoft.VisualStudio.Modeling.Diagrams
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.10.0.dll)
public override double GridSize { get; set; }

Property Value

Type: System.Double
The size of the grid for the diagram.

When a shape is moved by the user, it snaps to a grid – that is, its position is adjusted so that the X and Y coordinates are multiples of the grid size. For each shape, the relevant grid size is specified by its own GridSize property, and the default value is the GridSize of the parent. The grid size of a diagram determines the default GridSize for its children.

Set this value to change the grid size for the diagram and the default for its child shapes.

If you want to change the default grid size for all instances of a diagram type, override DefaultGridSize.

To switch off grid adjustment, set the GridSize to 0.0.

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ