menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class CircularPointer - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Class CircularPointer

    Represents the pointer visual element that moves along the circular scale of the circular gauge.

    Inheritance
    System.Object
    GaugeElement
    CircularPointer
    Inherited Members
    GaugeElement.BackgroundBrush
    GaugeElement.BackgroundBrushProperty
    GaugeElement.BorderBrush
    GaugeElement.BorderBrushProperty
    GaugeElement.BorderWidth
    GaugeElement.BorderWidthProperty
    Namespace: Syncfusion.Windows.Gauge
    Assembly: Syncfusion.Gauge.WPF.dll
    Syntax
    public class CircularPointer : GaugeElement
    Remarks

    To use a pointer as a MarkerPointer, the PointerNeedleType should be set to marker and MarkerStyle can be choosed from the available styles.

    Examples
    
    
    
     
    
    
    
    
    
    
    
    using System;
    using System.Windows;
    using System.Windows.Controls;
    using Syncfusion.Windows.Shared;
    using Syncfusion.Windows.Gauge;

    namespace CircularPointerSample { public partial class Window1 : Window { private CircularScale m_scale; private CircularGauge m_gauge; public Window1() { InitializeComponent();

    m_scale = new CircularScale(); m_gauge = new CircularGauge(); m_scale.ShadowOffset = 1; m_scale.Minimum = 0; m_scale.Maximum = 100; m_scale.MinorIntervalValue = 2; m_scale.MajorIntervalValue = 10; m_scale.StartAngle = 120; m_scale.GapSweepAngle = 300; m_scale.ScaleBarSize = 1.5; m_scale.Radius = 116; this.m_gauge.Scales.Add(m_scale); CircularPointer pointer1 = new CircularPointer(); pointer1.PointerLength = 100; pointer1.PointerWidth = 20; pointer1.PointerPlacement = ScalePlacement.Outside; m_scale.Pointers.Add(pointer1); this.Content = m_gauge; } } }

    Constructors

    CircularPointer()

    Initializes a new instance of the CircularPointer class.

    Declaration
    public CircularPointer()

    Fields

    AnimationDurationProperty

    Identifies the AnimationDuration dependency property.

    Declaration
    public static readonly DependencyProperty AnimationDurationProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    DecrementKeyProperty

    Identifies the DecrementKey dependency property.

    Declaration
    public static readonly DependencyProperty DecrementKeyProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    EnablePointerInteractionProperty

    Identifies the EnablePointerInteraction dependency property.

    Declaration
    public static readonly DependencyProperty EnablePointerInteractionProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    EnableSizeToContainerProperty

    Identifies the EnableSizeToContainer dependency property.

    Declaration
    public static readonly DependencyProperty EnableSizeToContainerProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    IncrementKeyProperty

    Identifies the IncrementKey dependency property.

    Declaration
    public static readonly DependencyProperty IncrementKeyProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    IsAnimationEnabledProperty

    Identifies the IsAnimationEnabled dependency property.

    Declaration
    public static readonly DependencyProperty IsAnimationEnabledProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    MarkerCustomGeometryProperty

    Identifies the MarkerCustomGeometry dependency property.

    Declaration
    public static readonly DependencyProperty MarkerCustomGeometryProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    MarkerStyleProperty

    Identifies the MarkerStyle dependency property.

    Declaration
    public static readonly DependencyProperty MarkerStyleProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    NeedleCustomGeometryProperty

    Identifies the NeedleCustomGeometry dependency property.

    Declaration
    public static readonly DependencyProperty NeedleCustomGeometryProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    NeedleStyleProperty

    Identifies the NeedleStyle dependency property.

    Declaration
    public static readonly DependencyProperty NeedleStyleProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    PointerLengthProperty

    Identifies the PointerLength dependency property.

    Declaration
    public static readonly DependencyProperty PointerLengthProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    PointerNeedleTypeProperty

    Identifies the PointerNeedleType dependency property.

    Declaration
    public static readonly DependencyProperty PointerNeedleTypeProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    PointerPlacementProperty

    Identifies the PointerPlacement dependency property.

    Declaration
    public static readonly DependencyProperty PointerPlacementProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    PointerWidthProperty

    Identifies the PointerWidth dependency property.

    Declaration
    public static readonly DependencyProperty PointerWidthProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    ValueProperty

    Identifies the Value dependency property.

    Declaration
    public static readonly DependencyProperty ValueProperty
    Field Value
    Type
    System.Windows.DependencyProperty

    Properties

    AnimationDuration

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

    Declaration
    public double AnimationDuration { get; set; }
    Property Value
    Type Description
    System.Double

    Type: System.Double Default value is Double.NaN.

    DecrementKey

    Gets or sets the Decrement key for the pointer. This is a dependency property.

    Declaration
    public Key DecrementKey { get; set; }
    Property Value
    Type Description
    System.Windows.Input.Key

    Type: System.Windows.Input.Key Default value is Down key.

    EnablePointerInteraction

    Gets or sets whether the pointer interactivity of the pointer is enabled or not. This is a dependency property.

    Declaration
    public bool EnablePointerInteraction { get; set; }
    Property Value
    Type Description
    System.Boolean

    Type: System.Boolean Default value is true.

    EnableSizeToContainer

    Gets or sets a value indicating whether [enable size to container].

    Declaration
    public bool EnableSizeToContainer { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if [enable size to container]; otherwise, false.

    IncrementKey

    Gets or sets the Increment key for the pointer. This is a dependency property.

    Declaration
    public Key IncrementKey { get; set; }
    Property Value
    Type Description
    System.Windows.Input.Key

    Type: System.Windows.Input.Key Default value is Up key.

    IsAnimationEnabled

    Gets or sets a value indicating whether animation is enabled or not.

    Declaration
    public bool IsAnimationEnabled { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if this instance ; otherwise, false.

    IsLogarithmic

    Gets or sets a value indicating whether IsLogarithmic value is true or false, so that log values can be displayed on the scale.This is a dependency property.

    Declaration
    public bool IsLogarithmic { get; set; }
    Property Value
    Type Description
    System.Boolean

    Type: System.Boolean Default IsLogarithmic is "False".

    See Also
    LogBase

    LogBase

    Gets or sets the LogBase value that can be displayed in the scale. This is a dependency property.

    Declaration
    public double LogBase { get; set; }
    Property Value
    Type Description
    System.Double

    Type: System.Double Default LogBase is 10.

    See Also
    IsLogarithmic

    MarkerCustomGeometry

    Gets or sets the custom geometry value for Marker.

    Declaration
    public Geometry MarkerCustomGeometry { get; set; }
    Property Value
    Type Description
    System.Windows.Media.Geometry

    Type : System.Windows.Media.Geometry Default Value is Null.

    MarkerStyle

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

    Declaration
    public MarkerStyle MarkerStyle { get; set; }
    Property Value
    Type Description
    MarkerStyle

    Type: MarkerStyle Default value is MarkerStyle.Rectangle.

    See Also
    NeedleStyle

    NeedleCustomGeometry

    Gets or sets the custom geometry value for Needle.

    Declaration
    public Geometry NeedleCustomGeometry { get; set; }
    Property Value
    Type Description
    System.Windows.Media.Geometry

    Type : System.Windows.Media.Geometry Default Value is Null.

    NeedleStyle

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

    Declaration
    public NeedleStyle NeedleStyle { get; set; }
    Property Value
    Type Description
    NeedleStyle

    Type: NeedleStyle Default value is NeedleStyle.Triangle.

    See Also
    MarkerStyle

    PointerLength

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

    Declaration
    public double PointerLength { get; set; }
    Property Value
    Type Description
    System.Double

    Type: System.Double Default value is 0.

    See Also
    PointerWidth

    PointerNeedleType

    Gets or sets the pointer needle type. This is a dependency property.

    Declaration
    public PointerNeedleType PointerNeedleType { get; set; }
    Property Value
    Type Description
    PointerNeedleType

    Type: PointerNeedleType Default value is PointerNeedleType.Needle.

    PointerPlacement

    Gets or sets the position to place the pointer relative to the scale. This is a dependency property.

    Declaration
    public ScalePlacement PointerPlacement { get; set; }
    Property Value
    Type Description
    ScalePlacement

    Type: ScalePlacement Default value is ScalePlacement.Inside.

    PointerWidth

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

    Declaration
    public double PointerWidth { get; set; }
    Property Value
    Type Description
    System.Double

    Type: System.Double Default value is 0.

    Value

    Gets or sets the value indicated by the pointer. This is a dependency property.

    Declaration
    public double Value { get; set; }
    Property Value
    Type Description
    System.Double

    Type: System.Double Default value is 0.

    Methods

    AngleToValue(Double, Double)

    Method to convert Angle to Value in circularknob.

    Declaration
    protected virtual double AngleToValue(double angle, double pointervalue)
    Parameters
    Type Name Description
    System.Double angle

    Angle value for conversion

    System.Double pointervalue

    previous pointer value

    Returns
    Type Description
    System.Double

    Value corresponding to that given angle

    ArrangeOverride(Size)

    Positions child elements and determines a size for the element.

    Declaration
    protected override Size ArrangeOverride(Size finalSize)
    Parameters
    Type Name Description
    System.Windows.Size finalSize

    The final area within the parent that this element should use to arrange itself and its children.

    Returns
    Type Description
    System.Windows.Size

    The actual size used.

    Remarks

    Method returns the actual size used as the same value as that of the size given by its parent to arrange the pointer. Instead of actually arranging the pointer, it just initializes the m_needlePath according to the shape of the pointer.

    CoercePointerLength(Object)

    Fulfils the logic before setting the value of PointerLength dependency property.

    Declaration
    protected virtual object CoercePointerLength(object value)
    Parameters
    Type Name Description
    System.Object value

    The value that should be corrected.

    Returns
    Type Description
    System.Object

    The corrected value.

    CoercePointerLength(DependencyObject, Object)

    Coerces the value of the PointerLength property.

    Declaration
    public static object CoercePointerLength(DependencyObject d, object value)
    Parameters
    Type Name Description
    System.Windows.DependencyObject d

    The CircularPointer object.

    System.Object value

    The instance containing the event data.

    Returns
    Type Description
    System.Object

    The checked value.

    CoerceValue(Object)

    Fulfils the logic before setting the value of Value dependency property.

    Declaration
    protected virtual object CoerceValue(object value)
    Parameters
    Type Name Description
    System.Object value

    The value that should be corrected.

    Returns
    Type Description
    System.Object

    The corrected value.

    CoerceValue(DependencyObject, Object)

    Coerces the value of the Value property.

    Declaration
    public static object CoerceValue(DependencyObject d, object value)
    Parameters
    Type Name Description
    System.Windows.DependencyObject d

    The CircularPointer object.

    System.Object value

    The instance containing the event data.

    Returns
    Type Description
    System.Object

    The checked value.

    GetAngleByValue(Double)

    Gets the corresponding angle for scale value passed.

    Declaration
    protected virtual double GetAngleByValue(double value)
    Parameters
    Type Name Description
    System.Double value

    Pointer value.

    Returns
    Type Description
    System.Double

    Calculated angle.

    Remarks

    • ratioCalculates the number of segments(between Maximum and Minimum values), that are possible,each of "value - Minimum" length.
    • angleCalculate the angles, of interval("value-Minimum") relative to Sweep angle of the Gauge and then adding the StartAngle to get the exact angle to place the Pointer.

    MeasureOverride(Size)

    Measures the size required for child elements in layout and determines a size for the this element.

    Declaration
    protected override Size MeasureOverride(Size availableSize)
    Parameters
    Type Name Description
    System.Windows.Size availableSize

    The available size that this element can give to child elements.

    Returns
    Type Description
    System.Windows.Size

    The size that this element determines it needs during layout.

    Remarks

    For "Bar" pointer, the height required is 1. For all the remaining pointer types , the size required is equal to their Height and Width.

    OnAnglePositionChanged(DependencyPropertyChangedEventArgs)

    Updates property value cache and raises AnglePositionChanged event.

    Declaration
    protected virtual void OnAnglePositionChanged(DependencyPropertyChangedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.DependencyPropertyChangedEventArgs e

    Property change details, such as old value and new value.

    OnAnimationDurationChanged(DependencyPropertyChangedEventArgs)

    Updates property value cache and raises AnimationDurationChanged event.

    Declaration
    protected virtual void OnAnimationDurationChanged(DependencyPropertyChangedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.DependencyPropertyChangedEventArgs e

    Property change details, such as old value and new value.

    OnDecrementKeyChanged(DependencyPropertyChangedEventArgs)

    Updates property value cache and raises DecrementKeyChanged event.

    Declaration
    protected virtual void OnDecrementKeyChanged(DependencyPropertyChangedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.DependencyPropertyChangedEventArgs e

    Property change details, such as old value and new value.

    OnEnablePointerInteractionChanged(DependencyPropertyChangedEventArgs)

    Updates property value cache and raises EnablePointerInteractionChanged event.

    Declaration
    protected virtual void OnEnablePointerInteractionChanged(DependencyPropertyChangedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.DependencyPropertyChangedEventArgs e

    Property change details, such as old value and new value.

    OnGotFocus(RoutedEventArgs)

    Invoked whenever an unhandled System.Windows.UIElement.GotFocus event reaches this element in its route.

    Declaration
    protected override void OnGotFocus(RoutedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.RoutedEventArgs e

    The System.Windows.RoutedEventArgs that contains the event data.

    OnIncrementKeyChanged(DependencyPropertyChangedEventArgs)

    Updates property value cache and raises IncrementKeyChanged event.

    Declaration
    protected virtual void OnIncrementKeyChanged(DependencyPropertyChangedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.DependencyPropertyChangedEventArgs e

    Property change details, such as old value and new value.

    OnInitialized(EventArgs)

    Initializes the Circular Pointer.

    Declaration
    protected override void OnInitialized(EventArgs e)
    Parameters
    Type Name Description
    System.EventArgs e

    The System.Windows.RoutedEventArgs that contains the event data.

    OnIsAnimationEnabledChanged(DependencyPropertyChangedEventArgs)

    Updates property value cache and raises IsAnimationEnabledChanged event.

    Declaration
    protected virtual void OnIsAnimationEnabledChanged(DependencyPropertyChangedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.DependencyPropertyChangedEventArgs e

    Property change details, such as old value and new value.

    OnLostFocus(RoutedEventArgs)

    Raises the System.Windows.UIElement.LostFocus routed event by using the event data that is provided.

    Declaration
    protected override void OnLostFocus(RoutedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.RoutedEventArgs e

    A System.Windows.RoutedEventArgs that contains event data. This event data must contain the identifier for the System.Windows.UIElement.LostFocus event.

    OnMarkerStyleChanged(DependencyPropertyChangedEventArgs)

    Updates property value cache and raises MarkerStyleChanged event.

    Declaration
    protected virtual void OnMarkerStyleChanged(DependencyPropertyChangedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.DependencyPropertyChangedEventArgs e

    Property change details, such as old value and new value.

    OnNeedleStyleChanged(DependencyPropertyChangedEventArgs)

    Updates property value cache and raises NeedleStyleChanged event.

    Declaration
    protected virtual void OnNeedleStyleChanged(DependencyPropertyChangedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.DependencyPropertyChangedEventArgs e

    Property change details, such as old value and new value.

    OnPointerLengthChanged(DependencyPropertyChangedEventArgs)

    Updates property value cache and raises PointerLengthChanged event.

    Declaration
    protected virtual void OnPointerLengthChanged(DependencyPropertyChangedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.DependencyPropertyChangedEventArgs e

    Property change details, such as old value and new value.

    OnPointerNeedleTypeChanged(DependencyPropertyChangedEventArgs)

    Updates property value cache and raises PointerNeedleTypeChanged event.

    Declaration
    protected virtual void OnPointerNeedleTypeChanged(DependencyPropertyChangedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.DependencyPropertyChangedEventArgs e

    Property change details, such as old value and new value.

    OnPointerPlacementChanged(DependencyPropertyChangedEventArgs)

    Updates property value cache and raises PointerPlacementChanged event.

    Declaration
    protected virtual void OnPointerPlacementChanged(DependencyPropertyChangedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.DependencyPropertyChangedEventArgs e

    Property change details, such as old value and new value.

    OnPointerWidthChanged(DependencyPropertyChangedEventArgs)

    Updates property value cache and raises PointerWidthChanged event.

    Declaration
    protected virtual void OnPointerWidthChanged(DependencyPropertyChangedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.DependencyPropertyChangedEventArgs e

    Property change details, such as old value and new value.

    OnRender(DrawingContext)

    Participates in rendering operations that are directed by the layout system.

    Declaration
    protected override void OnRender(DrawingContext drawingContext)
    Parameters
    Type Name Description
    System.Windows.Media.DrawingContext drawingContext

    The drawing instructions for a specific element.

    Remarks

    The shadow offset is calculated according to the CircularGauge and is stored. If the pointer is of type Marker, there is no need to rotate the pointer. All the remaining pointer types are rotated by an angle of 180. The actual pointer and the shadow of the pointer is drawn.(Since the pointer is drawn at the center of the Gauge and then transformed to its actual location,all non-rectangular shaped pointers should be rotated)

    OnValueChanged(DependencyPropertyChangedEventArgs)

    Updates property value cache and raises ValueChanged event.

    Declaration
    protected virtual void OnValueChanged(DependencyPropertyChangedEventArgs e)
    Parameters
    Type Name Description
    System.Windows.DependencyPropertyChangedEventArgs e

    Property change details, such as old value and new value.

    Remarks

    Animation is provided whenever the value of the pointer changes. Animation is provided to the pointer between pointer's old position and its new position.

    RefreshAnglePosition()

    Updates the angle position of the pointer.

    Declaration
    protected virtual void RefreshAnglePosition()
    Remarks

    The pointer is set to appropriate angle based on the value of the pointer. If the PointerType is Needle, then a simple rotation of the needle to the appropriate angle is enough. If it is of type Marker, then based on the pointer's ScalePlacement appropriate X position is calculated(Note: All the calculations are done with regard to the original position of the pointer, i.e Center of the Gauge) and the Marker is rotated.

    Events

    AnglePositionChanged

    Event that is raised when Syncfusion.Windows.Gauge.CircularPointer.AnglePosition property is changed.

    Declaration
    public event PropertyChangedCallback AnglePositionChanged
    Event Type
    Type
    System.Windows.PropertyChangedCallback

    AnimationDurationChanged

    Event that is raised when AnimationDuration property is changed.

    Declaration
    public event PropertyChangedCallback AnimationDurationChanged
    Event Type
    Type
    System.Windows.PropertyChangedCallback

    DecrementKeyChanged

    Event that is raised when DecrementKey property is changed.

    Declaration
    public event PropertyChangedCallback DecrementKeyChanged
    Event Type
    Type
    System.Windows.PropertyChangedCallback

    EnablePointerInteractionChanged

    Event that is raised when EnablePointerInteraction property is changed.

    Declaration
    public event PropertyChangedCallback EnablePointerInteractionChanged
    Event Type
    Type
    System.Windows.PropertyChangedCallback

    IncrementKeyChanged

    Event that is raised when IncrementKey property is changed.

    Declaration
    public event PropertyChangedCallback IncrementKeyChanged
    Event Type
    Type
    System.Windows.PropertyChangedCallback

    IsAnimationEnabledChanged

    Event that is raised when AnimationDuration property is changed.

    Declaration
    public event PropertyChangedCallback IsAnimationEnabledChanged
    Event Type
    Type
    System.Windows.PropertyChangedCallback

    MarkerCustomGeometryChanged

    Event that will raise when MarkerCustomGeometry property is changed.

    Declaration
    public event PropertyChangedCallback MarkerCustomGeometryChanged
    Event Type
    Type
    System.Windows.PropertyChangedCallback

    MarkerStyleChanged

    Event that is raised when MarkerStyle property is changed.

    Declaration
    public event PropertyChangedCallback MarkerStyleChanged
    Event Type
    Type
    System.Windows.PropertyChangedCallback

    NeedleCustomGeometryChanged

    Event that will raise when NeedleCustomGeometry property is changed.

    Declaration
    public event PropertyChangedCallback NeedleCustomGeometryChanged
    Event Type
    Type
    System.Windows.PropertyChangedCallback

    NeedleStyleChanged

    Event that is raised when NeedleStyle property is changed.

    Declaration
    public event PropertyChangedCallback NeedleStyleChanged
    Event Type
    Type
    System.Windows.PropertyChangedCallback

    PointerLengthChanged

    Event that is raised when PointerLength property is changed.

    Declaration
    public event PropertyChangedCallback PointerLengthChanged
    Event Type
    Type
    System.Windows.PropertyChangedCallback

    PointerNeedleTypeChanged

    Event that is raised when PointerNeedleType property is changed.

    Declaration
    public event PropertyChangedCallback PointerNeedleTypeChanged
    Event Type
    Type
    System.Windows.PropertyChangedCallback

    PointerPlacementChanged

    Event that is raised when PointerPlacement property is changed.

    Declaration
    public event PropertyChangedCallback PointerPlacementChanged
    Event Type
    Type
    System.Windows.PropertyChangedCallback

    PointerWidthChanged

    Event that is raised when PointerWidth property is changed.

    Declaration
    public event PropertyChangedCallback PointerWidthChanged
    Event Type
    Type
    System.Windows.PropertyChangedCallback

    ValueChanged

    Event that is raised when Value property is changed.

    Declaration
    public event PropertyChangedCallback ValueChanged
    Event Type
    Type
    System.Windows.PropertyChangedCallback
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved