DragZoomingTool

StockSharp.Xaml.Diagram.GXDiagram.Tool

The DragZoomingTool lets the user zoom into a diagram by stretching a box to indicate the new contents of the diagram's viewport (the area of the model shown by the DiagramPanel).

Inherits: DiagramTool

Properties

Box
protected Node Box { get; set; }
value = dragZoomingTool.Box
dragZoomingTool.Box = value

Gets or sets the temporary node acting as the "rubber-band" box that the user is stretching with a mouse drag.

BoxTemplate
public DataTemplate BoxTemplate { get; set; }
value = dragZoomingTool.BoxTemplate
dragZoomingTool.BoxTemplate = value

Gets or sets the DataTemplate that renders the "rubber-band" box that the user draws to specify the zoom area.

ZoomedDiagram
public Diagram ZoomedDiagram { get; set; }
value = dragZoomingTool.ZoomedDiagram
dragZoomingTool.ZoomedDiagram = value

Gets or sets the Diagram that will be scaled and scrolled according to the value of ComputeBoxBounds by Rect).

Methods

CanStart
public override bool CanStart()
result = dragZoomingTool.CanStart()

This tool can run when there has been a mouse-drag, far enough away not to be a click.

ComputeBoxBounds
protected virtual Rect ComputeBoxBounds()
result = dragZoomingTool.ComputeBoxBounds()

This just returns a Rect stretching from the mouse-down point to a point guided by the current mouse point and the aspect ratio of the ZoomedDiagram.

CreateBox
protected virtual Node CreateBox()
result = dragZoomingTool.CreateBox()

Create a Node using BoxTemplate as its DataTemplate.

Returns: a Node that is not bound to data

DoActivate
public override void DoActivate()
dragZoomingTool.DoActivate()

Call CreateBox to create the "rubber-band" box, remember it as the Box property, and add it to the diagram's PartsModel.

DoDeactivate
public override void DoDeactivate()
dragZoomingTool.DoDeactivate()

Cleanup any Box.

DoMouseMove
public override void DoMouseMove()
dragZoomingTool.DoMouseMove()

While dragging the mouse, position and size the Box according to the bounds produced by ComputeBoxBounds.

DoMouseUp
public override void DoMouseUp()
dragZoomingTool.DoMouseUp()

Upon the mouse-up, call Rect) with the value of ComputeBoxBounds and stop this tool.

DoStart
public override void DoStart()
dragZoomingTool.DoStart()

Capture the mouse when starting this tool.

DoStop
public override void DoStop()
dragZoomingTool.DoStop()

Release the mouse capture when stopping this tool.

ZoomToRect
public virtual void ZoomToRect(Rect brect)
dragZoomingTool.ZoomToRect(brect)

This method is called to zoom the ZoomedDiagram to match the given rectangle.

brect
a rectangle in model coordinates

Fields

BoxTemplateProperty
public static readonly DependencyProperty BoxTemplateProperty
value = DragZoomingTool.BoxTemplateProperty

Identifies the BoxTemplate dependency property.

ZoomedDiagramProperty
public static readonly DependencyProperty ZoomedDiagramProperty
value = DragZoomingTool.ZoomedDiagramProperty

Identifies the ZoomedDiagram dependency property.