LinkingTool

StockSharp.Xaml.Diagram.GXDiagram.Tool

The LinkingTool lets a user draw a new Link between two ports, using a mouse-drag operation.

Inherits: LinkingBaseTool

Properties

Direction : LinkingDirection

Gets or sets the direction in which new links may be drawn.

StartElement : FrameworkElement

Gets or sets the FrameworkElement at which FindLinkablePort should start its search.

StartPort : FrameworkElement

Gets or sets the port element at which the linking operation started.

Methods

CanStart() : bool

This tool can run when the diagram allows linking, the model is modifiable, the left-button mouse drag has moved far enough away to not be click, and when FindLinkablePort has returned a valid port.

DoActivate()

Start the linking operation.

DoDeactivate()

Finishing the linking operation stops the model edit and resets the cursor.

DoMouseUp()

A mouse-up ends the linking operation; if there is a valid TargetPort nearby, this calls Object) to create a new link.

DoStop()

Clean up tool state.

FindLinkablePort() : FrameworkElement

Return the element at the mouse-down point, if it is part of a node and if it is valid to link with it.

Returns: If the Direction is Either or ForwardsOnly, this checks the element and its parent Node by calling FrameworkElement). If the Direction is Either or BackwardsOnly, this checks the element and its parent Node by calling FrameworkElement). In either case finding a matching port will return that port and set Forwards in the appropriate direction. Otherwise this will return null.

Fields

DirectionProperty : DependencyProperty

Identifies the Direction dependency property.