AxisDragModifierBase
Provides base class for dragging operations on axes
Inherits: ChartModifierBase
Constructors
protected AxisDragModifierBase()
axisDragModifierBase = AxisDragModifierBase()
Initializes a new instance of the AxisDragModifierBase class.
Properties
public string AxisId { get; set; }
value = axisDragModifierBase.AxisId
axisDragModifierBase.AxisId = value
Defines which YAxis to bind the YAxisDragModifier to, matching by string Id
public AxisDragModes DragMode { get; set; }
value = axisDragModifierBase.DragMode
axisDragModifierBase.DragMode = value
Gets or sets the DragMode of the YAxisDragModifier. This modifier may be used to scale the VisibleRange or pan the VisibleRange creating a scrolling or vertical pan effect.
public bool IsDragging { get; protected set; }
value = axisDragModifierBase.IsDragging
axisDragModifierBase.IsDragging = value
Gets a value indicating whether the user is currently dragging the axis
public double MinTouchArea { get; set; }
value = axisDragModifierBase.MinTouchArea
axisDragModifierBase.MinTouchArea = value
Gets or sets minimal area of recognition (min height for horizontal axis or min width for vertical), where user click or touch triggers zoom behavior.
Methods
protected virtual DoubleRange CalculateRelativeRange(IRange fromRange, IAxis axis)
result = axisDragModifierBase.CalculateRelativeRange(fromRange, axis)
When overriden in a derived class, calculates an output IRange to apply to the associated AxisBaseAxis, given the input parameters.
- fromRange
- The input range, expecting a VisibleRange
- axis
- The axis being operated on
Returns: The output IRange which can then be applied to the GrowBy property to get the same affect as applying the input visible-range
protected abstract IRange CalculateScaledRange(Point currentPoint, Point lastPoint, bool isSecondHalf, IAxis axis)
result = axisDragModifierBase.CalculateScaledRange(currentPoint, lastPoint, isSecondHalf, axis)
When overriden in a derived class, calculates an output IRange to apply to the associated AxisBaseAxis, given the input parameters
- currentPoint
- The current mouse position
- lastPoint
- The last mouse position
- isSecondHalf
- A flag, which determines how the scale operates, e.g. which half of the axis (top or bottom, left or right) was dragged
- axis
- The axis being operated on
Returns: The output IRange
protected abstract IAxis GetCurrentAxis()
result = axisDragModifierBase.GetCurrentAxis()
Gets the IAxis instance, which current modifier is associated with, on the parent UltrachartSurface
protected virtual bool GetIsSecondHalf(Point point, Rect axisBounds, bool isHorizontalAxis)
result = axisDragModifierBase.GetIsSecondHalf(point, axisBounds, isHorizontalAxis)
Gets whether the specified mouse point is within the second (right-most or top-most) half of the Axis bounds
- point
- The mouse point
- axisBounds
- The axis bounds
- isHorizontalAxis
- Value, which indicates whether current axis is horizontal or not
Returns: True if the point is within the second (right-most or top-most) half of the axis bounds, else false
protected virtual Cursor GetUsedCursor(IAxis axis)
result = axisDragModifierBase.GetUsedCursor(axis)
Depending on axis orientation, returns a Cursor to show during mouse-over of the axis
- axis
- The axis instance
public override void OnAttached()
axisDragModifierBase.OnAttached()
Called when the Chart Modifier is attached to the Chart Surface
public override void OnDetached()
axisDragModifierBase.OnDetached()
Called immediately before the Chart Modifier is detached from the Chart Surface
protected override void OnIsEnabledChanged()
axisDragModifierBase.OnIsEnabledChanged()
Called when the IsEnabled property changes on this ChartModifierBase instance
public override void OnModifierMouseDown(ModifierMouseArgs e)
axisDragModifierBase.OnModifierMouseDown(e)
Called when a Mouse Button is pressed on the parent UltrachartSurface
- e
- Arguments detailing the mouse button operation
public override void OnModifierMouseMove(ModifierMouseArgs e)
axisDragModifierBase.OnModifierMouseMove(e)
Called when the Mouse is moved on the parent UltrachartSurface
- e
- Arguments detailing the mouse move operation
public override void OnModifierMouseUp(ModifierMouseArgs e)
axisDragModifierBase.OnModifierMouseUp(e)
Called when a Mouse Button is released on the parent UltrachartSurface
- e
- Arguments detailing the mouse button operation
protected abstract void PerformPan(Point currentPoint, Point lastPoint)
axisDragModifierBase.PerformPan(currentPoint, lastPoint)
Peforms a pan on the assocaited AxisBase. The pan is considered to be a drag from to
- currentPoint
- The current mouse point
- lastPoint
- The last mouse point
protected virtual void PerformScale(Point currentPoint, Point lastPoint, bool isSecondHalf)
axisDragModifierBase.PerformScale(currentPoint, lastPoint, isSecondHalf)
Performs a Scale on the associated AxisBase. The scale is considered to be a drag from to
- currentPoint
- The current mouse point
- lastPoint
- The last mouse point
- isSecondHalf
- Boolean flag to determine which side of the axis is scaled
private void SetAxisCursor(Cursor cursor)
axisDragModifierBase.SetAxisCursor(cursor)
Sets passed cursor on current axis, or default cursor returned by IAxis)
Fields
private static readonly DependencyProperty AxisIdProperty
value = AxisDragModifierBase.AxisIdProperty
Defines the YAxisId DependencyProperty
public static readonly DependencyProperty DragModeProperty
value = AxisDragModifierBase.DragModeProperty
Defines the DragMode DependencyProperty
public static readonly DependencyProperty MinTouchAreaProperty
value = AxisDragModifierBase.MinTouchAreaProperty
Defines the MinTouchArea DependencyProperty