Class
SnappingService

This class is accountable for calculating snapping related transformations for position and size.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.Windows.Diagrams.Core.dll

Syntax:

cs-api-definition
public class SnappingService : GraphServiceBase, ISnappingService

Inheritance: objectGraphServiceBaseSnappingService

Implements: ISnappingService

Inherited Members GraphServiceBase.Graph

Constructors

SnappingService(IGraphInternal)

Initializes a new instance of the SnappingService class.

Declaration

cs-api-definition
public SnappingService(IGraphInternal graph)

Parameters

graph

IGraphInternal

The graph.

Methods

ClearSnap()

Clears after the snap action.

Declaration

cs-api-definition
public virtual void ClearSnap()

Implements ISnappingService.ClearSnap()

InitializeSnap(IEnumerable<IShape>, IDiagramItem, bool, bool, Point)

Initializes the snap action.

Declaration

cs-api-definition
public virtual void InitializeSnap(IEnumerable<IShape> staticItems, IDiagramItem mainItem, bool isSnapToItemsEnabled, bool isSnapToGridEnabled, Point initialPosition)

Parameters

staticItems

IEnumerable<IShape>

The static items - the items that you don't drag at the moment.

mainItem

IDiagramItem

The main item - the item that drag started from.

isSnapToItemsEnabled

bool

The is snap to items enabled.

isSnapToGridEnabled

bool

The is snap to grid enabled.

initialPosition

Point

The initial position.

Implements ISnappingService.InitializeSnap(IEnumerable<IShape>, IDiagramItem, bool, bool, Point)

SetSnappingEngine(SnappingEngine)

Changes the snapping engine.

Declaration

cs-api-definition
public virtual void SetSnappingEngine(SnappingEngine snappingEngine)

Parameters

snappingEngine

SnappingEngine

Implements ISnappingService.SetSnappingEngine(SnappingEngine)

SnapItems(IEnumerable<IDiagramItem>, Point)

Snaps the new dragging position.

Declaration

cs-api-definition
public virtual Point SnapItems(IEnumerable<IDiagramItem> selectedItems, Point newPosition)

Parameters

selectedItems

IEnumerable<IDiagramItem>

The selected items.

newPosition

Point

The new position.

Returns

Point

Implements ISnappingService.SnapItems(IEnumerable<IDiagramItem>, Point)

SnapPoint(Point)

Snaps point.

Declaration

cs-api-definition
public virtual Point SnapPoint(Point point)

Parameters

point

Point

The point to snap.

Returns

Point

The snapped point.

Implements ISnappingService.SnapPoint(Point)

Events

SnappingLinesCalculated

Occurs when snapping lines have been calculated.

Declaration

cs-api-definition
public event EventHandler<SnappingLinesCalculatedEventArgs> SnappingLinesCalculated

Event Value

EventHandler<SnappingLinesCalculatedEventArgs>

Implements ISnappingService.SnappingLinesCalculated