LinkingBaseTool

StockSharp.Xaml.Diagram.GXDiagram.Tool

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

Inherits: DiagramTool

Constructors

LinkingBaseTool
protected LinkingBaseTool()
linkingBaseTool = LinkingBaseTool()

This does common initialization for the linking tools.

Properties

Forwards
protected bool Forwards { get; set; }
value = linkingBaseTool.Forwards
linkingBaseTool.Forwards = value

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

OriginalFromNode
protected Node OriginalFromNode { get; set; }
value = linkingBaseTool.OriginalFromNode
linkingBaseTool.OriginalFromNode = value

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

OriginalFromPort
protected FrameworkElement OriginalFromPort { get; set; }
value = linkingBaseTool.OriginalFromPort
linkingBaseTool.OriginalFromPort = value

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

OriginalToNode
protected Node OriginalToNode { get; set; }
value = linkingBaseTool.OriginalToNode
linkingBaseTool.OriginalToNode = value

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

OriginalToPort
protected FrameworkElement OriginalToPort { get; set; }
value = linkingBaseTool.OriginalToPort
linkingBaseTool.OriginalToPort = value

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

PortGravity
public double PortGravity { get; set; }
value = linkingBaseTool.PortGravity
linkingBaseTool.PortGravity = value

Gets or sets the distance at which link snapping occurs.

TargetPort
protected FrameworkElement TargetPort { get; set; }
value = linkingBaseTool.TargetPort
linkingBaseTool.TargetPort = value

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

TemporaryFromNode
public Node TemporaryFromNode { get; set; }
value = linkingBaseTool.TemporaryFromNode
linkingBaseTool.TemporaryFromNode = value

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

TemporaryFromPort
protected FrameworkElement TemporaryFromPort { get; }
value = linkingBaseTool.TemporaryFromPort

Gets the element representing the port for the TemporaryFromNode.

TemporaryLinkTemplate
public DataTemplate TemporaryLinkTemplate { get; set; }
value = linkingBaseTool.TemporaryLinkTemplate
linkingBaseTool.TemporaryLinkTemplate = value

Gets or sets the DataTemplate used to render the TemporaryLink.

TemporaryNodeTemplate
public DataTemplate TemporaryNodeTemplate { get; set; }
value = linkingBaseTool.TemporaryNodeTemplate
linkingBaseTool.TemporaryNodeTemplate = value

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

TemporaryToNode
public Node TemporaryToNode { get; set; }
value = linkingBaseTool.TemporaryToNode
linkingBaseTool.TemporaryToNode = value

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

TemporaryToPort
protected FrameworkElement TemporaryToPort { get; }
value = linkingBaseTool.TemporaryToPort

Gets the element representing the port for the TemporaryToNode.

ValidPortsCache
protected Dictionary<FrameworkElement, bool> ValidPortsCache { get; set; }
value = linkingBaseTool.ValidPortsCache
linkingBaseTool.ValidPortsCache = value

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

Methods

CopyPortProperties
protected virtual void CopyPortProperties(Node realnode, FrameworkElement realport, Node tempnode, FrameworkElement tempport, bool toend)
linkingBaseTool.CopyPortProperties(realnode, realport, tempnode, tempport, toend)

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

realnode
realport
tempnode
tempport
toend
CreateTemporaryNode
protected virtual Node CreateTemporaryNode(bool toend)
result = linkingBaseTool.CreateTemporaryNode(toend)

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
public override void DoMouseMove()
linkingBaseTool.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
public override void DoStart()
linkingBaseTool.DoStart()

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

DoStop
public override void DoStop()
linkingBaseTool.DoStop()

Release the mouse capture and clear out any temporary state.

FindTargetPort
protected virtual FrameworkElement FindTargetPort(bool toend)
result = linkingBaseTool.FindTargetPort(toend)

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
public virtual bool IsInSameNode(FrameworkElement fromport, FrameworkElement toport)
result = linkingBaseTool.IsInSameNode(fromport, toport)

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

fromport
toport
IsLinked
public virtual bool IsLinked(FrameworkElement fromport, FrameworkElement toport)
result = linkingBaseTool.IsLinked(fromport, toport)

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
public virtual bool IsValidFrom(Node fromnode, FrameworkElement fromport)
result = linkingBaseTool.IsValidFrom(fromnode, fromport)

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
public virtual bool IsValidTo(Node tonode, FrameworkElement toport)
result = linkingBaseTool.IsValidTo(tonode, toport)

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
protected virtual void SetNoTargetPortProperties(Node tempnode, FrameworkElement tempport)
linkingBaseTool.SetNoTargetPortProperties(tempnode, tempport)

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

tempnode
tempport

Fields

PortGravityProperty
public static readonly DependencyProperty PortGravityProperty
value = LinkingBaseTool.PortGravityProperty

Identifies the PortGravity dependency property.

TemporaryLinkTemplateProperty
public static readonly DependencyProperty TemporaryLinkTemplateProperty
value = LinkingBaseTool.TemporaryLinkTemplateProperty

Identifies the TemporaryLinkTemplate dependency property.

TemporaryNodeTemplateProperty
public static readonly DependencyProperty TemporaryNodeTemplateProperty
value = LinkingBaseTool.TemporaryNodeTemplateProperty

Identifies the TemporaryNodeTemplate dependency property.