Class SnapConstraints
Specifies the constraints to enable/ disable snapping and to controls the visibility of gridlines.
Inheritance
System.Object
SnapConstraints
Namespace: Syncfusion.Blazor.Diagrams
Assembly: Syncfusion.Blazor.dll
Syntax
public sealed class SnapConstraints : Enum
Remarks
To know more about using the snap constraints, refer to this link |
1. Constraints |
2. Gridlines |
To apply show horizontal lines snap constraints, use the below code. |
Examples
<SfDiagram Height="600px" Nodes="@NodeCollection">
@* Initialize the snapsettings with constraints *@
<DiagramSnapSettings Constraints = "SnapConstraints.ShowHorizontalLines" ></ DiagramSnapSettings >
</ SfDiagram >
@code{
ObservableCollection<DiagramNode> NodeCollection;
protected override void OnInitialized()
{
//Initialize the NodeCollection.
NodeCollection = new ObservableCollection<DiagramNode>();
DiagramNode node = new DiagramNode()
{
Id = "node1",
Height = 100,
Width = 100,
OffsetX = 100,
OffsetY = 100,
};
NodeCollection.Add(node);
}
}
Fields
All
Shows gridlines and enables snapping.
Declaration
public const SnapConstraints All
Field Value
Type | Description |
---|---|
SnapConstraints |
None
Disable to snapping the nodes/connectors in the diagram.
Declaration
public const SnapConstraints None
Field Value
Type | Description |
---|---|
SnapConstraints |
ShowHorizontalLines
Displays only the horizontal gridlines in the diagram.
Declaration
public const SnapConstraints ShowHorizontalLines
Field Value
Type | Description |
---|---|
SnapConstraints |
ShowLines
Display both Horizontal and Vertical gridlines.
Declaration
public const SnapConstraints ShowLines
Field Value
Type | Description |
---|---|
SnapConstraints |
ShowVerticalLines
Displays only the Vertical gridlines in the diagram.
Declaration
public const SnapConstraints ShowVerticalLines
Field Value
Type | Description |
---|---|
SnapConstraints |
SnapToHorizontalLines
Enables the object to snap only with horizontal gridlines.
Declaration
public const SnapConstraints SnapToHorizontalLines
Field Value
Type | Description |
---|---|
SnapConstraints |
SnapToLines
Enables the object to snap with both horizontal and vertical gridlines.
Declaration
public const SnapConstraints SnapToLines
Field Value
Type | Description |
---|---|
SnapConstraints |
SnapToObject
Enables the object to snap with the other objects in the diagram.
Declaration
public const SnapConstraints SnapToObject
Field Value
Type | Description |
---|---|
SnapConstraints |
SnapToVerticalLines
Enables the object to snap only with Vertical gridlines.
Declaration
public const SnapConstraints SnapToVerticalLines
Field Value
Type | Description |
---|---|
SnapConstraints |
value__
Declaration
public int value__
Field Value
Type | Description |
---|---|
System.Int32 |