LinkingBaseTool

StockSharp.Xaml.Diagram.GXDiagram.Tool

This abstract class is the base class for LinkingTool and RelinkingTool.

Inherits: DiagramTool

Constructors

LinkingBaseTool()

This does common initialization for the linking tools.

Properties

Forwards : bool

Gets or sets whether the linking operation is in the forwards direction.

OriginalFromNode : Node

Gets or sets the original node from which the link was connected.

OriginalFromPort : FrameworkElement

Gets or sets the FrameworkElement that is the port from which the link was connected.

OriginalToNode : Node

Gets or sets the original node to which the link was connected.

OriginalToPort : FrameworkElement

Gets or sets the FrameworkElement that is the port to which the link was connected.

PortGravity : double

Gets or sets the distance at which link snapping occurs.

TargetPort : FrameworkElement

Gets or sets a proposed FrameworkElement port for connecting a link.

TemporaryFromNode : Node

Gets or sets the temporary Node at the "from" end of the link.

TemporaryFromPort : FrameworkElement

Gets the element representing the port for the TemporaryFromNode.

TemporaryLinkTemplate : DataTemplate

Gets or sets the DataTemplate used to render the TemporaryLink.

TemporaryNodeTemplate : DataTemplate

Gets or sets the DataTemplate used to render the TemporaryFromNode and TemporaryToNode.

TemporaryToNode : Node

Gets or sets the temporary Node at the "to" end of the link.

TemporaryToPort : FrameworkElement

Gets the element representing the port for the TemporaryToNode.

ValidPortsCache : Dictionary<FrameworkElement, bool>

Gets or sets the dictionary used to keep track of ports for which a link may be valid.

Methods

CopyPortProperties(Node, FrameworkElement, Node, FrameworkElement, bool)

Make a temporary port look and act like a real one.

realnode
realport
tempnode
tempport
toend
CreateTemporaryNode(bool) : Node

Construct a Node to act as a temporary node.

toend

Returns: an unbound Node defined by the TemporaryNodeTemplate, or if that is null, by the default template named "DefaultTemporaryNodeTemplate".

DoMouseMove()

Mouse movement results in the temporary node moving to where the valid TargetPort is located, or to where the mouse is if there is no valid target port nearby.

DoStart()

If needed, call Boolean) and CreateTemporaryLink, and capture the mouse.

DoStop()

Release the mouse capture and clear out any temporary state.

FindTargetPort(bool) : FrameworkElement

Find a port with which the user could complete a valid link.

toend
true if looking for a "to" port

Returns: a FrameworkElement representing a valid port, or null if no such port is near the current mouse point (within PortGravity distance)

IsInSameNode(FrameworkElement, FrameworkElement) : bool

This predicate is true if both argument ports are in the same Node.

fromport
toport
IsLinked(FrameworkElement, FrameworkElement) : bool

This predicate is true if there is a link in the model going from to .

fromport
a FrameworkElement representing the "from" port
toport
a FrameworkElement representing the "to" port
IsValidFrom(Node, FrameworkElement) : bool

This predicate is true if it is permissible to connect a link from a given node/port.

fromnode
fromport

Returns: False if the is in a Layer that does not AllowLink. False if DependencyObject) for the is either false or null. False if the number of links connected to the would exceed the DependencyObject) value. Otherwise true.

IsValidTo(Node, FrameworkElement) : bool

This predicate is true if it is permissible to connect a link to a given node/port.

tonode
toport

Returns: False if the is in a Layer that does not AllowLink. False if DependencyObject) for the is either false or null. False if the number of links connected to the would exceed the DependencyObject) value. Otherwise true.

SetNoTargetPortProperties(Node, FrameworkElement)

Reset temporary port properties to neutral values when there is no target port.

tempnode
tempport

Fields

PortGravityProperty : DependencyProperty

Identifies the PortGravity dependency property.

TemporaryLinkTemplateProperty : DependencyProperty

Identifies the TemporaryLinkTemplate dependency property.

TemporaryNodeTemplateProperty : DependencyProperty

Identifies the TemporaryNodeTemplate dependency property.