LinkingBaseTool
This abstract class is the base class for LinkingTool and RelinkingTool.
Herda de: DiagramTool
Construtores
LinkingBaseTool()
This does common initialization for the linking tools.
Propriedades
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.
OriginalLink : Link
Gets or sets the original Link being reconnected by the RelinkingTool.
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.
TemporaryLink : Link
Gets or sets the temporary Link that is shown while the user is drawing or reconnecting a link.
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.
Métodos
CopyPortProperties(Node, FrameworkElement, Node, FrameworkElement, bool)
Make a temporary port look and act like a real one.
- realnode
- realport
- tempnode
- tempport
- toend
CreateTemporaryLink() : Link
Construct a Link to act as a temporary link.
CreateTemporaryNode(bool) : Node
Construct a Node to act as a temporary node.
- toend
Retorna: 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
Retorna: 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
Retorna: 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.
IsValidLink(Node, FrameworkElement, Node, FrameworkElement) : bool
This predicate should be true when it is logically valid to connect a link from one node/port to another node/port.
- fromnode
- the "from" Node
- fromport
- the "from" FrameworkElement
- tonode
- the "to" Node (perhaps the same as )
- toport
- the "to" FrameworkElement (perhaps the same as )
Retorna: False if FrameworkElement) is false for the and . False if FrameworkElement) is false for the and . False if FrameworkElement) is true unless DependencyObject) is true for both ports. False if FrameworkElement) is true unless DependencyObject) is true for both ports. False if trying to link to the link's own label node(s). False if Object) or one of the model-specific IsRelinkValid methods is false, depending on whether OriginalLink is null (a new link) or non-null (a relink). 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
Retorna: 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
Campos
PortGravityProperty : DependencyProperty
Identifies the PortGravity dependency property.
TemporaryLinkTemplateProperty : DependencyProperty
Identifies the TemporaryLinkTemplate dependency property.
TemporaryNodeTemplateProperty : DependencyProperty
Identifies the TemporaryNodeTemplate dependency property.