In This Article

PointerBase Class

Represents a base class for pointers.

public abstract class PointerBase : GaugeElement, ILogicalParent, IVisualParent
Inheritance:
object Visual UIElement FrameworkElement GaugeElement object
Derived:
CircularPointerBase LinearPointerBase
Implements:
ILogicalParent IVisualParent

Constructors

PointerBase()

Initializes an instance of the class.

protected PointerBase()

Properties

Background

The background brush.

public Brush? Background { get; set; }

Property Value

Brush:

The default value is DarkGray.

BorderBrush

The border brush.

public Brush? BorderBrush { get; set; }

Property Value

Brush:

The default value is Black.

BorderDashStyle

The border dash style.

public DashStyle? BorderDashStyle { get; set; }

Property Value

DashStyle:

The default value is Solid.

BorderWidth

The border width.

public double BorderWidth { get; set; }

Property Value

double:

The default value is 0.

CanDrag

Indicates whether the pointer can be dragged by the mouse.

public bool CanDrag { get; set; }

Property Value

bool:

true if the pointer can be dragged by the mouse, false. The default value is false.

DampeningMaximumDuration

The maximum Duration of the dampening effect.

public Duration DampeningMaximumDuration { get; set; }

Property Value

Duration:

The default value is 750 milliseconds.

DampeningMinimumDuration

The minimum Duration of the dampening effect.

public Duration DampeningMinimumDuration { get; set; }

Property Value

Duration:

The default value is 250 milliseconds.

DisplayValue

The value currently displayed.

public double DisplayValue { get; protected set; }

Property Value

double:

The default value is 0.

DragCursor

The Cursor used during drag operations.

public Cursor DragCursor { get; set; }

Property Value

Cursor:

The default value is Hand.

HasDropShadow

Indicates whether this instance has a drop shadow.

public bool HasDropShadow { get; set; }

Property Value

bool:

true if this instance has a drop shadow; otherwise, false. The default value is true.

IsDragging

Indicates whether the pointer is currently being dragged by the mouse.

public bool IsDragging { get; }

Property Value

bool:

true if the pointer is currently being dragged by the mouse; otherwise, false. The default value is false.

IsDraggingAnimated

Indicates whether the pointer is animated when it is being dragged.

public bool IsDraggingAnimated { get; set; }

Property Value

bool:

true if the pointer is animated when it is being dragged; otherwise, false. The default value is false.

IsLogarithmic

Indicates whether this instance uses a logarithmic scale.

protected bool IsLogarithmic { get; }

Property Value

bool:

true if this instance uses a logarithmic scale; otherwise, false.

IsReversed

Indicates whether this instance is reversed.

protected bool IsReversed { get; }

Property Value

bool:

true if this instance is reversed; otherwise, false.

IsSnappingEnabled

Indicates whether the Value should be snapped to a specified interval.

public bool IsSnappingEnabled { get; set; }

Property Value

bool:

true if the Value should be snapped to a specified interval; otherwise, false. The default value is false.

IsValueChangedEventRaised

Indicates whether the ValueChanged should be raised.

public bool IsValueChangedEventRaised { get; set; }

Property Value

bool:

true if the ValueChanged should be raised; otherwise, false. The default value is true.

IsValueChangingEventRaised

Indicates whether the ValueChanging should be raised.

public bool IsValueChangingEventRaised { get; set; }

Property Value

bool:

true if the ValueChanging should be raised; otherwise, false. The default value is false.

LogarithmicBase

The logarithm base when using a logarithmic scale.

protected double LogarithmicBase { get; }

Property Value

double

Maximum

The maximum value.

protected double Maximum { get; }

Property Value

double

Minimum

The minimum value.

protected double Minimum { get; }

Property Value

double

PointerAscent

The ascent of the pointer.

public Unit PointerAscent { get; set; }

Property Value

Unit:

The default value is 0 pixels.

PointerExtent

The extent of the pointer.

public Unit PointerExtent { get; set; }

Property Value

Unit:

The default value is 0 pixels.

RefreshRate

The Duration between value updates.

public Duration RefreshRate { get; set; }

Property Value

Duration:

The default value is 0.0 milliseconds.

ScaleOffset

The offset from the scale based on the ScalePlacement.

public Unit ScaleOffset { get; set; }

Property Value

Unit:

The default value is 0px.

ScalePlacement

The placement of the pointer relative to the scale.

public ScalePlacement ScalePlacement { get; set; }

Property Value

ScalePlacement:

The default value is Overlay.

SnappingInterval

An interval to which the value is snapped when IsSnappingEnabled is true.

public double SnappingInterval { get; set; }

Property Value

double:

The default value is 1.

SnappingMode

The snapping mode of the pointer when snapping is enabled.

public PointerSnappingMode SnappingMode { get; set; }

Property Value

PointerSnappingMode:

The default value is Default, which always snaps when snapping is enabled.

ThrottledValue

The throttled Value based on RefreshRate.

public double ThrottledValue { get; }

Property Value

double

Value

The value.

public double Value { get; set; }

Property Value

double:

The default value is 0.

Methods

CalculateValue(Point)

Calculates the value based on a specified point.

protected abstract double CalculateValue(Point point)
Parameter Type Description
point Point

The point.

Returns

double

CancelDrag()

Cancels a drag operation for the PointerBase.

public void CancelDrag()

Remarks

If a PointerBase is currently dragging, this method removes mouse capture and restores the previous value.

OnCreateAutomationPeer()

Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.

protected override AutomationPeer? OnCreateAutomationPeer()

Returns

AutomationPeer:

The type-specific AutomationPeer implementation.

OnKeyDown(KeyEventArgs)

Invoked when an unhandled System.Windows.Input.Keyboard.KeyDown attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

protected override void OnKeyDown(KeyEventArgs e)
Parameter Type Description
e KeyEventArgs

The KeyEventArgs that contains the event data.

OnMouseLeftButtonDown(MouseButtonEventArgs)

Invoked when an unhandled MouseLeftButtonDown routed event is raised on this element. Implement this method to add class handling for this event.

protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameter Type Description
e MouseButtonEventArgs

The MouseButtonEventArgs that contains the event data. The event data reports that the left mouse button was pressed.

OnMouseLeftButtonUp(MouseButtonEventArgs)

Invoked when an unhandled MouseLeftButtonUp routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
Parameter Type Description
e MouseButtonEventArgs

The MouseButtonEventArgs that contains the event data. The event data reports that the left mouse button was released.

OnMouseMove(MouseEventArgs)

Invoked when an unhandled System.Windows.Input.Mouse.MouseMove attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

protected override void OnMouseMove(MouseEventArgs e)
Parameter Type Description
e MouseEventArgs

The MouseEventArgs that contains the event data.

OnValueChanged(double, double)

Invoked when the Value property is changed.

protected virtual void OnValueChanged(double oldValue, double newValue)
Parameter Type Description
oldValue double

The old property value.

newValue double

The new property value.

StartDrag(MouseButtonEventArgs)

Starts a thumb drag.

public void StartDrag(MouseButtonEventArgs e)
Parameter Type Description
e MouseButtonEventArgs

The source MouseButtonEventArgs that can be used to capture the pointer.

UpdateValue(Point)

Updates the value of this pointer based on the specified point.

protected virtual void UpdateValue(Point point)
Parameter Type Description
point Point

The point.

Events

ValueChanged

Occurs when the Value is changed.

public event EventHandler<DoublePropertyChangedRoutedEventArgs> ValueChanged

Event Type

EventHandler<DoublePropertyChangedRoutedEventArgs>

ValueChanging

Occurs before the Value is changed.

public event EventHandler<DoublePropertyChangingRoutedEventArgs> ValueChanging

Event Type

EventHandler<DoublePropertyChangingRoutedEventArgs>

Fields

BackgroundProperty

Defines the Background property.

public static readonly DependencyProperty BackgroundProperty

BorderBrushProperty

Defines the BorderBrush property.

public static readonly DependencyProperty BorderBrushProperty

BorderDashStyleProperty

Defines the BorderDashStyle property.

public static readonly DependencyProperty BorderDashStyleProperty

BorderWidthProperty

Defines the BorderWidth property.

public static readonly DependencyProperty BorderWidthProperty

CanDragProperty

Defines the CanDrag property.

public static readonly DependencyProperty CanDragProperty

DampeningMaximumDurationProperty

Defines the DampeningMaximumDuration property.

public static readonly DependencyProperty DampeningMaximumDurationProperty

DampeningMinimumDurationProperty

Defines the DampeningMinimumDuration property.

public static readonly DependencyProperty DampeningMinimumDurationProperty

DisplayValueProperty

Defines the DisplayValue property.

public static readonly DependencyProperty DisplayValueProperty

DragCursorProperty

Defines the DragCursor property.

public static readonly DependencyProperty DragCursorProperty

HasDropShadowProperty

Defines the HasDropShadow property.

public static readonly DependencyProperty HasDropShadowProperty

IsDraggingAnimatedProperty

Defines the IsDraggingAnimated property.

public static readonly DependencyProperty IsDraggingAnimatedProperty

IsDraggingProperty

Defines the IsDragging property.

public static readonly DependencyProperty IsDraggingProperty

IsSnappingEnabledProperty

Defines the IsSnappingEnabled property.

public static readonly DependencyProperty IsSnappingEnabledProperty

IsValueChangedEventRaisedProperty

Defines the IsValueChangedEventRaised property.

public static readonly DependencyProperty IsValueChangedEventRaisedProperty

IsValueChangingEventRaisedProperty

Defines the IsValueChangingEventRaised property.

public static readonly DependencyProperty IsValueChangingEventRaisedProperty

PointerAscentProperty

Defines the PointerAscent property.

public static readonly DependencyProperty PointerAscentProperty

PointerExtentProperty

Defines the PointerExtent property.

public static readonly DependencyProperty PointerExtentProperty

RefreshRateProperty

Defines the RefreshRate property.

public static readonly DependencyProperty RefreshRateProperty

ScaleOffsetProperty

Defines the ScaleOffset property.

public static readonly DependencyProperty ScaleOffsetProperty

ScalePlacementProperty

Defines the ScalePlacement property.

public static readonly DependencyProperty ScalePlacementProperty

SnappingIntervalProperty

Defines the SnappingInterval property.

public static readonly DependencyProperty SnappingIntervalProperty

SnappingModeProperty

Defines the SnappingMode property.

public static readonly DependencyProperty SnappingModeProperty

ThrottledValueProperty

Defines the ThrottledValue property.

public static readonly DependencyProperty ThrottledValueProperty

ValueChangedEvent

Defines the ValueChanged event.

public static readonly RoutedEvent ValueChangedEvent

ValueChangingEvent

Defines the ValueChanging event.

public static readonly RoutedEvent ValueChangingEvent

ValueProperty

Defines the Value property.

public static readonly DependencyProperty ValueProperty

Inherited Members

Extension Methods