PointerBase Class
Represents a base class for pointers.
public abstract class PointerBase : GaugeElement, DUCE.IResource, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IHaveResources, IQueryAmbient, ILogicalParent, IVisualParent
- Inheritance:
- System.Object System.Windows.Threading.DispatcherObject System.Windows.DependencyObject System.Windows.Media.Visual System.Windows.UIElement System.Windows.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
- System.Windows.Media.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
- System.Windows.Media.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
- System.Windows.Media.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
- System.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
- System.Boolean:
true
if the pointer can be dragged by the mouse,false
. The default value isfalse
.
DampeningMaximumDuration
Gets or sets the maximum System.Windows.Duration of the dampening effect. This is a dependency property.
public Duration DampeningMaximumDuration { get; set; }
Property Value
- System.Windows.Duration:
The maximum System.Windows.Duration of the dampening effect. The default value is
750
milliseconds.
DampeningMinimumDuration
Gets or sets the minimum System.Windows.Duration of the dampening effect. This is a dependency property.
public Duration DampeningMinimumDuration { get; set; }
Property Value
- System.Windows.Duration:
The minimum System.Windows.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
- System.Double:
The display value. The default value is
0
.
DragCursor
Gets or sets the System.Windows.Input.Cursor used during drag operations. This is a dependency property.
public Cursor DragCursor { get; set; }
Property Value
- System.Windows.Input.Cursor:
The System.Windows.Input.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
- System.Boolean:
true
if this instance has a drop shadow; otherwise,false
. The default value istrue
.
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
- System.Boolean:
true
if the pointer is currently being dragged by the mouse; otherwise,false
. The default value isfalse
.
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
- System.Boolean:
true
if the pointer is animated when it is being dragged; otherwise,false
. The default value isfalse
.
IsLogarithmic
Gets a value indicating whether this instance uses a logarithmic scale.
protected bool IsLogarithmic { get; }
Property Value
- System.Boolean:
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
- System.Boolean:
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
- System.Boolean:
true
if the Value should be snapped to a specified interval; otherwise,false
. The default value isfalse
.
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
- System.Boolean:
true
if the ValueChanged should be raised; otherwise,false
. The default value istrue
.
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
- System.Boolean:
true
if the ValueChanging should be raised; otherwise,false
. The default value isfalse
.
LogarithmicBase
Gets the logarithm base when using a logarithmic scale.
protected double LogarithmicBase { get; }
Property Value
- System.Double:
The logarithm base.
Maximum
Gets the maximum value.
protected double Maximum { get; }
Property Value
- System.Double:
The maximum value.
Minimum
Gets the minimum value.
protected double Minimum { get; }
Property Value
- System.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 System.Windows.Duration between value updates. This is a dependency property.
public Duration RefreshRate { get; set; }
Property Value
- System.Windows.Duration:
The System.Windows.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
- System.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
- System.Double:
The throttled value.
Value
Gets or sets the value. This is a dependency property.
public double Value { get; set; }
Property Value
- System.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 | System.Windows.Point | The point. |
Returns
- System.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
- System.Windows.Automation.Peers.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 | System.Windows.Input.KeyEventArgs | The System.Windows.Input.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 | System.Windows.Input.MouseButtonEventArgs | The System.Windows.Input.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 | System.Windows.Input.MouseButtonEventArgs | The System.Windows.Input.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 | System.Windows.Input.MouseEventArgs | The System.Windows.Input.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 | System.Double | The old property value. |
newValue | System.Double | The new property value. |
StartDrag(MouseButtonEventArgs)
Starts a thumb drag.
public void StartDrag(MouseButtonEventArgs e)
Parameter | Type | Description |
---|---|---|
e | System.Windows.Input.MouseButtonEventArgs | The source System.Windows.Input.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 | System.Windows.Point | The point. |
Events
ValueChanged
Occurs when the Value is changed.
public event EventHandler<DoublePropertyChangedRoutedEventArgs> ValueChanged
Event Type
- System.EventHandler<DoublePropertyChangedRoutedEventArgs>
ValueChanging
Occurs before the Value is changed.
public event EventHandler<DoublePropertyChangingRoutedEventArgs> ValueChanging
Event Type
- System.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
- GaugeElement.ZIndexProperty
- GaugeElement.ILogicalParent.AddLogicalChild(Object)
- GaugeElement.ILogicalParent.RemoveLogicalChild(Object)
- GaugeElement.IVisualParent.AddVisualChild(Visual)
- GaugeElement.IVisualParent.RemoveVisualChild(Visual)
- GaugeElement.GetVisualChild(Int32)
- GaugeElement.GetZIndex(UIElement)
- GaugeElement.SetZIndex(UIElement, Int32)
- GaugeElement.VisualChildren
- GaugeElement.VisualChildrenCount
- GaugeElement.ZIndex
- System.Object.ToString()
- System.Object.Equals(System.Object)
- System.Object.Equals(System.Object, System.Object)
- System.Object.ReferenceEquals(System.Object, System.Object)
- System.Object.GetHashCode()
- System.Object.GetType()
- System.Object.MemberwiseClone()
Extension Methods
- FrameworkElementExtensions.AnimateDoubleProperty(String, Double, Double, Double, Nullable<Double>, Nullable<Double>)
- FrameworkElementExtensions.BindToProperty(DependencyProperty, Object, String, BindingMode, IValueConverter, Object)
- FrameworkElementExtensions.BindToProperty(DependencyProperty, Object, DependencyProperty, BindingMode, IValueConverter, Object)
- FrameworkElementExtensions.GetCurrentSize()