RotatingTool

StockSharp.Xaml.Diagram.GXDiagram.Tool

The RotatingTool is used to interactively change the angle of an element.

Inherits: DiagramTool

Properties

AdornedElement
protected FrameworkElement AdornedElement { get; set; }
value = rotatingTool.AdornedElement
rotatingTool.AdornedElement = value

Gets or sets the current FrameworkElement that is being rotated.

AdornedNode
protected Node AdornedNode { get; }
value = rotatingTool.AdornedNode

Gets the current Node that the AdornedElement is in.

Handle
protected FrameworkElement Handle { get; set; }
value = rotatingTool.Handle
rotatingTool.Handle = value

Gets or sets the current rotate handle that is being dragged.

OriginalAngle
protected double OriginalAngle { get; set; }
value = rotatingTool.OriginalAngle
rotatingTool.OriginalAngle = value

Gets or sets the angle of the AdornedElement when the user started rotating.

RotationPoint
protected Point RotationPoint { get; set; }
value = rotatingTool.RotationPoint
rotatingTool.RotationPoint = value

Gets or sets the point around which the element is being rotated.

SnapAngleEpsilon
public double SnapAngleEpsilon { get; set; }
value = rotatingTool.SnapAngleEpsilon
rotatingTool.SnapAngleEpsilon = value

Gets or sets the closeness to a desired angle at which the angle is "snapped to".

SnapAngleMultiple
public double SnapAngleMultiple { get; set; }
value = rotatingTool.SnapAngleMultiple
rotatingTool.SnapAngleMultiple = value

Gets or sets the preferred angles for the selected element.

Methods

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

The RotatingTool may run when there is a mouse-down event on a rotate handle.

ComputeRotate
protected virtual double ComputeRotate(Point newPoint)
result = rotatingTool.ComputeRotate(newPoint)

Compute the new angle given a Point.

newPoint
a Point in model coordinates

Returns: the new angle, in degrees

DoActivate
public override void DoActivate()
rotatingTool.DoActivate()

Start rotation.

DoCancel
public override void DoCancel()
rotatingTool.DoCancel()

Restore the OriginalAngle of the AdornedElement and stop this tool.

DoDeactivate
public override void DoDeactivate()
rotatingTool.DoDeactivate()

This stops the current edit (StopTransaction).

DoMouseMove
public override void DoMouseMove()
rotatingTool.DoMouseMove()

Call Double) with a new angle determined by the mouse point.

DoMouseUp
public override void DoMouseUp()
rotatingTool.DoMouseUp()

Call Double) with an angle based on the most recent mouse point and raise an "object rotated" event before stopping the tool.

DoRotate
protected virtual void DoRotate(double newangle)
rotatingTool.DoRotate(newangle)

Change the angle of the AdornedElement.

newangle
the new angle, in degrees
DoStart
public override void DoStart()
rotatingTool.DoStart()

Capture the mouse when starting this tool.

DoStop
public override void DoStop()
rotatingTool.DoStop()

Release the mouse capture when stopping this tool.

UpdateAdornments
public override void UpdateAdornments(Part part)
rotatingTool.UpdateAdornments(part)

Show an Adornment with a rotate handle at a point to the side of the AdornedElement, if the node is selected and visible and if CanRotate is true.

part

Fields

SnapAngleEpsilonProperty
public static readonly DependencyProperty SnapAngleEpsilonProperty
value = RotatingTool.SnapAngleEpsilonProperty

Identifies the SnapAngleEpsilon dependency property.

SnapAngleMultipleProperty
public static readonly DependencyProperty SnapAngleMultipleProperty
value = RotatingTool.SnapAngleMultipleProperty

Identifies the SnapAngleMultiple dependency property.