DragSelectingTool
The DragSelectingTool lets the user select multiple parts within a rectangular area drawn by the user.
Inherits: DiagramTool
Properties
protected Node Box { get; set; }
value = dragSelectingTool.Box
dragSelectingTool.Box = value
Gets or sets the temporary node acting as the "rubber-band" box that the user is stretching with a mouse drag.
public DataTemplate BoxTemplate { get; set; }
value = dragSelectingTool.BoxTemplate
dragSelectingTool.BoxTemplate = value
Gets or sets the DataTemplate that renders the "rubber-band" box that the user draws to specify the selection area.
public int Delay { get; set; }
value = dragSelectingTool.Delay
dragSelectingTool.Delay = value
Gets or sets how long the mouse must be stationary before CanStart may return true.
public SearchInclusion Include { get; set; }
value = dragSelectingTool.Include
dragSelectingTool.Include = value
Gets or sets the conditions under which parts are selected.
Methods
public override bool CanStart()
result = dragSelectingTool.CanStart()
This tool can run when the diagram allows selection, there has been delay of at least Delay milliseconds after the mouse-down before a mouse-move, there has been a mouse-drag far enough away not to be a click, and there is no selectable part at the mouse-down point.
protected virtual Rect ComputeBoxBounds()
result = dragSelectingTool.ComputeBoxBounds()
This just returns a Rect stretching from the mouse-down point to the current mouse point.
protected virtual Node CreateBox()
result = dragSelectingTool.CreateBox()
Create a Node using BoxTemplate as its DataTemplate.
public override void DoActivate()
dragSelectingTool.DoActivate()
Call CreateBox to create the "rubber-band" box, remember it as the Box property, and add it to the diagram's PartsModel.
public override void DoMouseMove()
dragSelectingTool.DoMouseMove()
While dragging the mouse, position and size the Box according to the bounds produced by ComputeBoxBounds.
public override void DoMouseUp()
dragSelectingTool.DoMouseUp()
Upon the mouse-up, call Rect) with the value of ComputeBoxBounds and stop this tool.
public override void DoStart()
dragSelectingTool.DoStart()
Capture the mouse when starting this tool.
public override void DoStop()
dragSelectingTool.DoStop()
Release the mouse capture when stopping this tool.
public virtual void SelectInRect(Rect r)
dragSelectingTool.SelectInRect(r)
This method is called to select some parts, governed by the value of Include.
- r
Fields
public static readonly DependencyProperty BoxTemplateProperty
value = DragSelectingTool.BoxTemplateProperty
Identifies the BoxTemplate dependency property.
public static readonly DependencyProperty DelayProperty
value = DragSelectingTool.DelayProperty
Identifies the Delay dependency property.
public static readonly DependencyProperty IncludeProperty
value = DragSelectingTool.IncludeProperty
Identifies the Include dependency property.