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

Remarks

For detailed documentation on this control's features and how to use them, please see the Gauge documentation topics.

Constructors

PointerBase()

Initializes a new instance of the PointerBase class.

protected PointerBase()

Properties

Background

Gets or sets the background brush. This is a dependency property.

public Brush Background { get; set; }

Property Value

Brush:

The background brush. The default value is DarkGray.

BorderBrush

Gets or sets the border brush. This is a dependency property.

public Brush BorderBrush { get; set; }

Property Value

Brush:

The border brush. The default value is Black.

BorderDashStyle

Gets or sets the border dash style. This is a dependency property.

public DashStyle BorderDashStyle { get; set; }

Property Value

DashStyle:

The border dash style. The default value is DashStyle.Solid.

BorderWidth

Gets or sets the border width. This is a dependency property.

public double BorderWidth { get; set; }

Property Value

double:

The border width. The default value is 0.

CanDrag

Gets or sets a value indicating whether the pointer can be dragged by the mouse. This is a dependency property.

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

Gets or sets the maximum Duration of the dampening effect. This is a dependency property.

public Duration DampeningMaximumDuration { get; set; }

Property Value

Duration:

The maximum Duration of the dampening effect. The default value is 750 milliseconds.

DampeningMinimumDuration

Gets or sets the minimum Duration of the dampening effect. This is a dependency property.

public Duration DampeningMinimumDuration { get; set; }

Property Value

Duration:

The minimum Duration of the dampening effect. The default value is 250 milliseconds.

DisplayValue

Gets the value currently displayed. This is a dependency property.

public double DisplayValue { get; protected set; }

Property Value

double:

The display value. The default value is 0.

DragCursor

Gets or sets the Cursor used during drag operations. This is a dependency property.

public Cursor DragCursor { get; set; }

Property Value

Cursor:

The Cursor used during drag operations. The default value is Cursors.Hand.

HasDropShadow

Gets or sets a value indicating whether this instance has a drop shadow. This is a dependency property.

public bool HasDropShadow { get; set; }

Property Value

bool:

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

IsDragging

Gets a value indicating whether the pointer is currently being dragged by the mouse. This is a dependency property.

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

Gets or sets a value indicating whether the pointer is animated when it is being dragged. This is a dependency property.

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

Gets a value indicating 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

Gets a value indicating whether this instance is reversed.

protected bool IsReversed { get; }

Property Value

bool:

true if this instance is reversed; otherwise, false.

IsSnappingEnabled

Gets or sets a value indicating whether the Value should be snapped to a specified interval. This is a dependency property.

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

Gets or sets a value indicating whether the ValueChanged should be raised. This is a dependency property.

public bool IsValueChangedEventRaised { get; set; }

Property Value

bool:

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

IsValueChangingEventRaised

Gets or sets a value indicating whether the ValueChanging should be raised. This is a dependency property.

public bool IsValueChangingEventRaised { get; set; }

Property Value

bool:

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

LogarithmicBase

Gets the logarithm base when using a logarithmic scale.

protected double LogarithmicBase { get; }

Property Value

double:

The logarithm base.

Maximum

Gets the maximum value.

protected double Maximum { get; }

Property Value

double:

The maximum value.

Minimum

Gets the minimum value.

protected double Minimum { get; }

Property Value

double:

The minimum value.

PointerAscent

Gets or sets the ascent of the pointer. This is a dependency property.

public Unit PointerAscent { get; set; }

Property Value

Unit:

The ascent of the pointer. The default value is 0 pixels.

PointerExtent

Gets or sets the extent of the pointer. This is a dependency property.

public Unit PointerExtent { get; set; }

Property Value

Unit:

The extent of the pointer. The default value is 0 pixels.

RefreshRate

Gets or sets the Duration between value updates. This is a dependency property.

public Duration RefreshRate { get; set; }

Property Value

Duration:

The Duration between value updates. The default value is 0.0 milliseconds.

ScaleOffset

Gets or sets the offset from the scale based on the ScalePlacement. This is a dependency property.

public Unit ScaleOffset { get; set; }

Property Value

Unit:

The scale offset. The default value is 0px.

ScalePlacement

Gets or sets the placement of the pointer relative to the scale. This is a dependency property.

public ScalePlacement ScalePlacement { get; set; }

Property Value

ScalePlacement:

The scale placement. The default value is ScalePlacement.Overlay.

SnappingInterval

Gets or sets an interval to which the value is snapped when IsSnappingEnabled is true. This is a dependency property.

public double SnappingInterval { get; set; }

Property Value

double:

The interval to which the value is snapped. The default value is 1.

SnappingMode

Gets or sets the snapping mode of the pointer when snapping is enabled. This is a dependency property.

public PointerSnappingMode SnappingMode { get; set; }

Property Value

PointerSnappingMode:

A PointerSnappingMode that indicates the snapping mode of the pointer when snapping is enabled. The default value is Default, which always snaps when snapping is enabled.

ThrottledValue

Gets the throttled Value based on RefreshRate.

public double ThrottledValue { get; }

Property Value

double:

The throttled value.

Value

Gets or sets the value. This is a dependency property.

public double Value { get; set; }

Property Value

double:

The value. 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:

The value of specified point.

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()

Creates an appropriate PointerBaseAutomationPeer for this control as part of the WPF infrastructure.

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer

OnKeyDown(KeyEventArgs)

Invoked when an unhandled 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 UIElement.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 UIElement.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 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

Identifies the Background dependency property. This field is read-only.

public static readonly DependencyProperty BackgroundProperty

BorderBrushProperty

Identifies the BorderBrush dependency property. This field is read-only.

public static readonly DependencyProperty BorderBrushProperty

BorderDashStyleProperty

Identifies the BorderDashStyle dependency property. This field is read-only.

public static readonly DependencyProperty BorderDashStyleProperty

BorderWidthProperty

Identifies the BorderWidth dependency property. This field is read-only.

public static readonly DependencyProperty BorderWidthProperty

CanDragProperty

Identifies the CanDrag dependency property. This field is read-only.

public static readonly DependencyProperty CanDragProperty

DampeningMaximumDurationProperty

Identifies the DampeningMaximumDuration dependency property. This field is read-only.

public static readonly DependencyProperty DampeningMaximumDurationProperty

DampeningMinimumDurationProperty

Identifies the DampeningMinimumDuration dependency property. This field is read-only.

public static readonly DependencyProperty DampeningMinimumDurationProperty

DisplayValueProperty

Identifies the read-only DisplayValue dependency property. This field is read-only.

public static readonly DependencyProperty DisplayValueProperty

DragCursorProperty

Identifies the DragCursor dependency property. This field is read-only.

public static readonly DependencyProperty DragCursorProperty

HasDropShadowProperty

Identifies the HasDropShadow dependency property. This field is read-only.

public static readonly DependencyProperty HasDropShadowProperty

IsDraggingAnimatedProperty

Identifies the IsDraggingAnimated dependency property. This field is read-only.

public static readonly DependencyProperty IsDraggingAnimatedProperty

IsDraggingProperty

Identifies the read-only IsDragging dependency property. This field is read-only.

public static readonly DependencyProperty IsDraggingProperty

IsSnappingEnabledProperty

Identifies the IsSnappingEnabled dependency property. This field is read-only.

public static readonly DependencyProperty IsSnappingEnabledProperty

IsValueChangedEventRaisedProperty

Identifies the IsValueChangedEventRaised dependency property. This field is read-only.

public static readonly DependencyProperty IsValueChangedEventRaisedProperty

IsValueChangingEventRaisedProperty

Identifies the IsValueChangingEventRaised dependency property. This field is read-only.

public static readonly DependencyProperty IsValueChangingEventRaisedProperty

PointerAscentProperty

Identifies the PointerAscent dependency property. This field is read-only.

public static readonly DependencyProperty PointerAscentProperty

PointerExtentProperty

Identifies the PointerExtent dependency property. This field is read-only.

public static readonly DependencyProperty PointerExtentProperty

RefreshRateProperty

Identifies the RefreshRate dependency property. This field is read-only.

public static readonly DependencyProperty RefreshRateProperty

ScaleOffsetProperty

Identifies the ScaleOffset dependency property. This field is read-only.

public static readonly DependencyProperty ScaleOffsetProperty

ScalePlacementProperty

Identifies the ScalePlacement dependency property. This field is read-only.

public static readonly DependencyProperty ScalePlacementProperty

SnappingIntervalProperty

Identifies the SnappingInterval dependency property. This field is read-only.

public static readonly DependencyProperty SnappingIntervalProperty

SnappingModeProperty

Identifies the SnappingMode dependency property. This field is read-only.

public static readonly DependencyProperty SnappingModeProperty

ThrottledValueProperty

Identifies the ThrottledValue dependency property. This field is read-only.

public static readonly DependencyProperty ThrottledValueProperty

ValueChangedEvent

Identifies the ValueChanged routed event. This field is read-only.

public static readonly RoutedEvent ValueChangedEvent

ValueChangingEvent

Identifies the ValueChanging routed event. This field is read-only.

public static readonly RoutedEvent ValueChangingEvent

ValueProperty

Identifies the Value dependency property. This field is read-only.

public static readonly DependencyProperty ValueProperty

Inherited Members