menu

WinUI

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

    Show / Hide Table of Contents

    Class NeedlePointer

    Create the pointer to indicate the value with needle or arrow shape. NeedlePointer contains three parts, namely needle, knob, and tail and that can be placed on a gauge to mark the values.

    Inheritance
    System.Object
    GaugePointer
    NeedlePointer
    Inherited Members
    GaugePointer.AnimationDuration
    GaugePointer.AnimationDurationProperty
    GaugePointer.AnimationEasingFunction
    GaugePointer.AnimationEasingFunctionProperty
    GaugePointer.EnableAnimation
    GaugePointer.EnableAnimationProperty
    GaugePointer.IsInteractive
    GaugePointer.IsInteractiveProperty
    GaugePointer.OnPointerReleased(PointerRoutedEventArgs)
    GaugePointer.Value
    GaugePointer.ValueChangeCompleted
    GaugePointer.ValueChanged
    GaugePointer.ValueChangeStarted
    GaugePointer.ValueChanging
    GaugePointer.ValueProperty
    Namespace: Syncfusion.UI.Xaml.Gauges
    Assembly: Syncfusion.Gauge.WinUI.dll
    Syntax
    public class NeedlePointer : GaugePointer
    Examples
    <gauge:SfRadialGauge>
        <gauge:SfRadialGauge.Axes>
            <gauge:RadialAxis>
                <gauge:RadialAxis.Pointers>
                    <gauge:NeedlePointer Value="50" />
                </gauge:RadialAxis.Pointers>
            </gauge:RadialAxis>
        </gauge:SfRadialGauge.Axes>
    </gauge:SfRadialGauge>

    Constructors

    NeedlePointer()

    Initializes a new instance of the NeedlePointer class.

    Declaration
    public NeedlePointer()
    Examples
    <gauge:SfRadialGauge>
        <gauge:SfRadialGauge.Axes>
            <gauge:RadialAxis>
                <gauge:RadialAxis.Pointers>
                    <gauge:NeedlePointer Value="50" />
                </gauge:RadialAxis.Pointers>
            </gauge:RadialAxis>
        </gauge:SfRadialGauge.Axes>
    </gauge:SfRadialGauge>

    Fields

    KnobFillProperty

    Identifies the KnobFill dependency property.

    Declaration
    public static readonly DependencyProperty KnobFillProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for KnobFill dependency property.

    KnobRadiusProperty

    Identifies the KnobRadius dependency property.

    Declaration
    public static readonly DependencyProperty KnobRadiusProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for KnobRadius dependency property.

    KnobSizeUnitProperty

    Identifies the KnobSizeUnit dependency property.

    Declaration
    public static readonly DependencyProperty KnobSizeUnitProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for KnobSizeUnit dependency property.

    KnobStrokeProperty

    Identifies the KnobStroke dependency property.

    Declaration
    public static readonly DependencyProperty KnobStrokeProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for KnobStroke dependency property.

    KnobStrokeThicknessProperty

    Identifies the KnobStrokeThickness dependency property.

    Declaration
    public static readonly DependencyProperty KnobStrokeThicknessProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for KnobStrokeThickness dependency property.

    NeedleEndWidthProperty

    Identifies the NeedleEndWidth dependency property.

    Declaration
    public static readonly DependencyProperty NeedleEndWidthProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for NeedleEndWidth dependency property.

    NeedleFillProperty

    Identifies the NeedleFill dependency property.

    Declaration
    public static readonly DependencyProperty NeedleFillProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for NeedleFill dependency property.

    NeedleLengthProperty

    Identifies the NeedleLength dependency property.

    Declaration
    public static readonly DependencyProperty NeedleLengthProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for NeedleLength dependency property.

    NeedleLengthUnitProperty

    Identifies the NeedleLengthUnit dependency property.

    Declaration
    public static readonly DependencyProperty NeedleLengthUnitProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for NeedleLengthUnit dependency property.

    NeedleStartWidthProperty

    Identifies the NeedleStartWidth dependency property.

    Declaration
    public static readonly DependencyProperty NeedleStartWidthProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for NeedleStartWidth dependency property.

    TailFillProperty

    Identifies the TailFill dependency property.

    Declaration
    public static readonly DependencyProperty TailFillProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for TailFill dependency property.

    TailLengthProperty

    Identifies the TailLength dependency property.

    Declaration
    public static readonly DependencyProperty TailLengthProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for TailLength dependency property.

    TailLengthUnitProperty

    Identifies the TailLengthUnit dependency property.

    Declaration
    public static readonly DependencyProperty TailLengthUnitProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for TailLengthUnit dependency property.

    TailWidthProperty

    Identifies the TailWidth dependency property.

    Declaration
    public static readonly DependencyProperty TailWidthProperty
    Field Value
    Type Description
    Microsoft.UI.Xaml.DependencyProperty

    The identifier for TailWidth dependency property.

    Properties

    KnobFill

    Gets or sets the Brush that paints the interior area of the knob.

    Declaration
    public Brush KnobFill { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Media.Brush

    A Brush that specifies how the knob is painted.

    Examples
    <gauge:SfRadialGauge>
        <gauge:SfRadialGauge.Axes>
            <gauge:RadialAxis>
                <gauge:RadialAxis.Pointers>
                    <gauge:NeedlePointer Value="50"
                                         KnobRadius="0.02"
                                         KnobFill="Red" />
                </gauge:RadialAxis.Pointers>
            </gauge:RadialAxis>
        </gauge:SfRadialGauge.Axes>
    </gauge:SfRadialGauge>

    KnobRadius

    Gets or sets a value that specifies the knob radius size.

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

    It defines the radius of the knob either in pixel or factor. The default value is 0.07d.

    Examples

    If KnobSizeUnit is Factor, value will be given from 0 to 1. Here knob radius size is calculated by KnobRadius * axis radius value. Example: KnobRadius value is 0.2 and axis radius is 100, knob radius is 20(0.2 * 100) logical pixels. if KnobSizeUnit is Pixel, defined value is set to the knob radius.

    <gauge:SfRadialGauge>
        <gauge:SfRadialGauge.Axes>
            <gauge:RadialAxis>
                <gauge:RadialAxis.Pointers>
                    <gauge:NeedlePointer Value="50"
                                         KnobRadius="0.02" />
                </gauge:RadialAxis.Pointers>
            </gauge:RadialAxis>
        </gauge:SfRadialGauge.Axes>
    </gauge:SfRadialGauge>

    KnobSizeUnit

    Gets or sets the value that indicates to calculate the knob radius in logical pixel or radius factor.

    Declaration
    public SizeUnit KnobSizeUnit { get; set; }
    Property Value
    Type Description
    SizeUnit

    One of the SizeUnit enumeration that specifies how the KnobRadius value is considered. The default mode is Factor.

    Examples
    <gauge:SfRadialGauge>
        <gauge:SfRadialGauge.Axes>
            <gauge:RadialAxis>
                <gauge:RadialAxis.Pointers>
                    <gauge:NeedlePointer Value="50"
                                         KnobRadius="0.02"
                                         KnobFill="Red"
                                         KnobStrokeThickness="2"
                                         KnobStroke="Blue"
                                         KnobSizeUnit="Factor" />
                </gauge:RadialAxis.Pointers>
            </gauge:RadialAxis>
        </gauge:SfRadialGauge.Axes>
    </gauge:SfRadialGauge>

    KnobStroke

    Gets or sets a value that specifies the knob border color.

    Declaration
    public Brush KnobStroke { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Media.Brush

    A Brush that specifies how the knob border is painted.

    Examples
    <gauge:SfRadialGauge>
        <gauge:SfRadialGauge.Axes>
            <gauge:RadialAxis>
                <gauge:RadialAxis.Pointers>
                    <gauge:NeedlePointer Value="50"
                                         KnobRadius="0.02"
                                         KnobFill="Red"
                                         KnobStrokeThickness="2"
                                         KnobStroke="Blue" />
                </gauge:RadialAxis.Pointers>
            </gauge:RadialAxis>
        </gauge:SfRadialGauge.Axes>
    </gauge:SfRadialGauge>

    KnobStrokeThickness

    Gets or sets the width of the knob stroke outline.

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

    It defines the thickness of the knob stroke. The default value is 0.

    Examples
    <gauge:SfRadialGauge>
        <gauge:SfRadialGauge.Axes>
            <gauge:RadialAxis>
                <gauge:RadialAxis.Pointers>
                    <gauge:NeedlePointer Value="50"
                                         KnobRadius="0.02"
                                         KnobStrokeThickness="2" />
                </gauge:RadialAxis.Pointers>
            </gauge:RadialAxis>
        </gauge:SfRadialGauge.Axes>
    </gauge:SfRadialGauge>

    NeedleEndWidth

    Gets or sets a value that specifies the end width of the needle pointer.

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

    It defines the width of the needle end. The default value is 15.

    Examples
    <gauge:SfRadialGauge>
        <gauge:SfRadialGauge.Axes>
            <gauge:RadialAxis>
                <gauge:RadialAxis.Pointers>
                    <gauge:NeedlePointer Value="50"
                                         NeedleLength="0.7"
                                         NeedleLengthUnit="Factor"
                                         NeedleStartWidth="10"
                                         NeedleEndWidth="10" />
                </gauge:RadialAxis.Pointers>
            </gauge:RadialAxis>
        </gauge:SfRadialGauge.Axes>
    </gauge:SfRadialGauge>

    NeedleFill

    Gets or sets the Brush that paints the interior area of the needle shape.

    Declaration
    public Brush NeedleFill { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Media.Brush

    A Brush that specifies how the needle is painted.

    Examples
    <gauge:SfRadialGauge>
        <gauge:SfRadialGauge.Axes>
            <gauge:RadialAxis>
                <gauge:RadialAxis.Pointers>
                    <gauge:NeedlePointer Value="50"
                                         NeedleLength="0.7"
                                         NeedleLengthUnit="Factor"
                                         NeedleStartWidth="10"
                                         NeedleEndWidth="10"
                                         NeedleFill="Red" />
                </gauge:RadialAxis.Pointers>
            </gauge:RadialAxis>
        </gauge:SfRadialGauge.Axes>
    </gauge:SfRadialGauge>

    NeedleLength

    Gets or sets a value that specifies the length of the needle pointer. You can specify value either in logical pixel or radius factor using the NeedleLengthUnit property.

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

    It defines the length of the needle either in pixel or factor. The default value is 0.75.

    Examples

    If NeedleLengthUnit is Factor, value will be given from 0 to 1. Here needle length is calculated by NeedleLength * axis radius value. Example: NeedleLength value is 0.2 and axis radius is 100, needle length is 20(0.2 * 100) logical pixels. if NeedleLengthUnit is Pixel, defined value is set to the needle length.

    <gauge:SfRadialGauge>
        <gauge:SfRadialGauge.Axes>
            <gauge:RadialAxis>
                <gauge:RadialAxis.Pointers>
                    <gauge:NeedlePointer Value="50"
                                         NeedleLength="0.7" />
                </gauge:RadialAxis.Pointers>
            </gauge:RadialAxis>
        </gauge:SfRadialGauge.Axes>
    </gauge:SfRadialGauge>

    NeedleLengthUnit

    Gets or sets a value that specifies to calculate the needle pointer length either in logical pixel or radius factor.

    Declaration
    public SizeUnit NeedleLengthUnit { get; set; }
    Property Value
    Type Description
    SizeUnit

    One of the SizeUnit enumeration that specifies how the NeedleLength value is considered. The default mode is Factor.

    Examples
    <gauge:SfRadialGauge>
        <gauge:SfRadialGauge.Axes>
            <gauge:RadialAxis>
                <gauge:RadialAxis.Pointers>
                    <gauge:NeedlePointer Value="50"
                                         NeedleLength="0.7"
                                         NeedleLengthUnit="Factor" />
                </gauge:RadialAxis.Pointers>
            </gauge:RadialAxis>
        </gauge:SfRadialGauge.Axes>
    </gauge:SfRadialGauge>

    NeedleStartWidth

    Gets or sets a value that specifies the start width of the needle pointer.

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

    It defines the width of the needle start. The default value is 2.

    Examples
    <gauge:SfRadialGauge>
        <gauge:SfRadialGauge.Axes>
            <gauge:RadialAxis>
                <gauge:RadialAxis.Pointers>
                    <gauge:NeedlePointer Value="50"
                                         NeedleLength="0.7"
                                         NeedleLengthUnit="Factor"
                                         NeedleStartWidth="10" />
                </gauge:RadialAxis.Pointers>
            </gauge:RadialAxis>
        </gauge:SfRadialGauge.Axes>
    </gauge:SfRadialGauge>

    TailFill

    Gets or sets the Brush that paints the interior area of the tail shape.

    Declaration
    public Brush TailFill { get; set; }
    Property Value
    Type Description
    Microsoft.UI.Xaml.Media.Brush

    A Brush that specifies how the tail is painted.

    Examples
    <gauge:SfRadialGauge>
        <gauge:SfRadialGauge.Axes>
            <gauge:RadialAxis>
                <gauge:RadialAxis.Pointers>
                    <gauge:NeedlePointer Value="50"
                                         TailLength="0.1"
                                         TailFill="Red" />
                </gauge:RadialAxis.Pointers>
            </gauge:RadialAxis>
        </gauge:SfRadialGauge.Axes>
    </gauge:SfRadialGauge>

    TailLength

    Gets or sets a value that specifies the needle pointer tail length. You can specify value either in logical pixel or radius factor using the TailLengthUnit property.

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

    It defines the tail length. The default value is 0.

    Examples

    If TailLengthUnit is Factor, value will be given from 0 to 1. Here tail length is calculated by TailLength * axis radius value. Example: TailLength value is 0.2 and axis radius is 100, tail length is 20(0.2 * 100) logical pixels. if TailLengthUnit is Pixel, defined value is set to the tail length.

    <gauge:SfRadialGauge>
        <gauge:SfRadialGauge.Axes>
            <gauge:RadialAxis>
                <gauge:RadialAxis.Pointers>
                    <gauge:NeedlePointer Value="50"
                                         TailLength="0.2" />
                </gauge:RadialAxis.Pointers>
            </gauge:RadialAxis>
        </gauge:SfRadialGauge.Axes>
    </gauge:SfRadialGauge>

    TailLengthUnit

    Gets or sets a value that specifies to calculate the needle pointer tail length either in logical pixel or radius factor.

    Declaration
    public SizeUnit TailLengthUnit { get; set; }
    Property Value
    Type Description
    SizeUnit

    One of the SizeUnit enumeration that specifies how the TailWidth value is considered. The default mode is Factor.

    Examples
    <gauge:SfRadialGauge>
        <gauge:SfRadialGauge.Axes>
            <gauge:RadialAxis>
                <gauge:RadialAxis.Pointers>
                    <gauge:NeedlePointer Value="50"
                                         TailLength="0.1"
                                         TailFill="Red"
                                         TailLengthUnit="Factor" />
                </gauge:RadialAxis.Pointers>
            </gauge:RadialAxis>
        </gauge:SfRadialGauge.Axes>
    </gauge:SfRadialGauge>

    TailWidth

    Gets or sets a value that specifies the start width of the needle pointer's tail.

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

    It defines the width of the tail. The default value is 15.

    Examples
    <gauge:SfRadialGauge>
        <gauge:SfRadialGauge.Axes>
            <gauge:RadialAxis>
                <gauge:RadialAxis.Pointers>
                    <gauge:NeedlePointer Value="50"
                                         TailLength="0.1"
                                         TailFill="Red"
                                         TailLengthUnit="Factor"
                                         TailWidth="20" />
                </gauge:RadialAxis.Pointers>
            </gauge:RadialAxis>
        </gauge:SfRadialGauge.Axes>
    </gauge:SfRadialGauge>

    Methods

    OnApplyTemplate()

    Invoke to render NeedlePointer class.

    Declaration
    protected override void OnApplyTemplate()

    OnCreateAutomationPeer()

    Declaration
    protected override AutomationPeer OnCreateAutomationPeer()
    Returns
    Type
    Microsoft.UI.Xaml.Automation.Peers.AutomationPeer
    Overrides
    GaugePointer.OnCreateAutomationPeer()

    OnPointerPressed(PointerRoutedEventArgs)

    Called when the pointer get pressed.

    Declaration
    protected override void OnPointerPressed(PointerRoutedEventArgs e)
    Parameters
    Type Name Description
    Microsoft.UI.Xaml.Input.PointerRoutedEventArgs e

    The pointer routed event arguments.

    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved