Northwoods.GoXam.Tool Namespace : LinkingTool Class |
LinkingTool
lets a user draw a new Northwoods.GoXam.Link between two ports, using a mouse-drag operation.<DesignTimeVisibleAttribute()> Public Class LinkingTool Inherits LinkingBaseTool Implements IDiagramTool, System.ComponentModel.ISupportInitialize, System.Windows.IFrameworkInputElement, System.Windows.IInputElement, System.Windows.Markup.IQueryAmbient, System.Windows.Media.Animation.IAnimatable
By default an instance of this tool is installed as a mouse-move tool in each Northwoods.GoXam.Diagram, as the value of Northwoods.GoXam.Diagram.LinkingTool. CanStart calls FindLinkablePort to find a valid "port" element from which (or to which) the user may interactively draw a new link. DoActivate sets up a temporary link and two temporary nodes, one at the start port and one following the mouse.
This tool does not utilize any Northwoods.GoXam.Adornments or tool handles.
This tool conducts a model edit (DiagramTool.StartTransaction and DiagramTool.StopTransaction) while the tool is DiagramTool.Active.
If you want to programmatically start a new user mouse-gesture to draw a new link from a given FrameworkElement
that may be a "port" element or may be within the visual tree of a "port" element, set the StartElement property to let FindLinkablePort find the real "port" element. Then start and activate this tool: myDiagram.LinkingTool.StartElement = ...; myDiagram.CurrentTool = myDiagram.LinkingTool; myDiagram.CurrentTool.DoActivate();
System.Object
System.Windows.Threading.DispatcherObject
System.Windows.DependencyObject
System.Windows.Media.Visual
System.Windows.UIElement
System.Windows.FrameworkElement
Northwoods.GoXam.Tool.DiagramTool
Northwoods.GoXam.Tool.LinkingBaseTool
Northwoods.GoXam.Tool.LinkingTool