WinUI

Upgrade Guide User Guide Demos Support Forums Download
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class BarPointer - WinUI API Reference | Syncfusion

    Show / Hide Table of Contents

    Class BarPointer

    Represents the bar pointer that is used to indicate the current value of the gauge in a linear bar shape.

    Inheritance
    System.Object
    LinearGaugePointer
    BarPointer
    Inherited Members
    LinearGaugePointer.ValueProperty
    LinearGaugePointer.EnableAnimationProperty
    LinearGaugePointer.AnimationDurationProperty
    LinearGaugePointer.AnimationEasingFunctionProperty
    LinearGaugePointer.Value
    LinearGaugePointer.EnableAnimation
    LinearGaugePointer.AnimationDuration
    LinearGaugePointer.AnimationEasingFunction
    LinearGaugePointer.ValueChanged
    Namespace: Syncfusion.UI.Xaml.Gauges
    Assembly: Syncfusion.Gauge.WinUI.dll
    Syntax
    public class BarPointer : LinearGaugePointer
    Examples

    The below examples shows, how to add bar pointers to linear axis in linear gauge.

    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Axis>
            <gauge:LinearAxis>
                <gauge:LinearAxis.BarPointers>
                    <gauge:BarPointer Value="50"
                                      PointerSize="10"
                                      Background="Orange" 
                                      CornerStyle="BothFlat"
                                      Offset="-15" />
                </gauge:LinearAxis.BarPointers>
            </gauge:LinearAxis>
        </gauge:SfLinearGauge.Axis>
    </gauge:SfLinearGauge>

    Constructors

    BarPointer()

    Initializes a new instance of the BarPointer class.

    Declaration
    public BarPointer()
    Examples

    The below examples shows, how to add bar pointers to linear axis in linear gauge.

    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Axis>
            <gauge:LinearAxis>
                <gauge:LinearAxis.BarPointers>
                    <gauge:BarPointer Value="50"
                                      PointerSize="10"
                                      Background="Orange" 
                                      CornerStyle="BothFlat"
                                      Offset="-15" />
                </gauge:LinearAxis.BarPointers>
            </gauge:LinearAxis>
        </gauge:SfLinearGauge.Axis>
    </gauge:SfLinearGauge>

    Fields

    ChildProperty

    Identifies the Child dependency property.

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

    The identifier for Child dependency property.

    CornerStyleProperty

    Identifies the CornerStyle dependency property.

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

    The identifier for CornerStyle dependency property.

    GradientStopsProperty

    Identifies the GradientStops dependency property.

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

    The identifier for GradientStops dependency property.

    OffsetProperty

    Identifies the Offset dependency property.

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

    The identifier for Offset dependency property.

    PointerSizeProperty

    Identifies the PointerSize dependency property.

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

    The identifier for PointerSize dependency property.

    Properties

    Child

    Gets or sets the child content of a BarPointer.

    Declaration
    public object Child { get; set; }
    Property Value
    Type Description
    System.Object

    An object that contains the pointer's visual child content. The default value is null.

    Examples
    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Axis>
            <gauge:LinearAxis ShowTicks="False"
                              ShowLabels="False"
                              CornerStyle="BothCurve"
                              AxisLineStrokeThickness="30">
                <gauge:LinearAxis.BarPointers>
                    <gauge:BarPointer Value="50"
                                      PointerSize="30"
                                      CornerStyle="BothCurve">
                        <gauge:BarPointer.Child>
                            <TextBlock Text="50%"
                                       Margin="0,0,10,0"
                                       Foreground="White"
                                       HorizontalAlignment="Right"
                                       VerticalAlignment="Center"/>
                        </gauge:BarPointer.Child>
                    </gauge:BarPointer>
                </gauge:LinearAxis.BarPointers>
            </gauge:LinearAxis>
        </gauge:SfLinearGauge.Axis>
    </gauge:SfLinearGauge>

    CornerStyle

    Gets or sets a CornerStyle enumeration value that describes the corner/edge style of the BarPointer.

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

    A value of the enumeration. The default is BothFlat.

    Examples
    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Axis>
            <gauge:LinearAxis>
                <gauge:LinearAxis.BarPointers>
                    <gauge:BarPointer Value="50"
                                      PointerSize="30"
                                      Offset="-15"
                                      CornerStyle="BothCurve" />
                </gauge:LinearAxis.BarPointers>
            </gauge:LinearAxis>
        </gauge:SfLinearGauge.Axis>
    </gauge:SfLinearGauge>

    GradientStops

    Gets or sets the collection of GaugeGradientStop that specifies how interior is painted with gradient brush on the BarPointer.

    Declaration
    public ObservableCollection<GaugeGradientStop> GradientStops { get; set; }
    Property Value
    Type Description
    System.Collections.ObjectModel.ObservableCollection<GaugeGradientStop>

    A collection of the GaugeGradientStop objects associated with the brush, each of which specifies a color and an offset along the axis. The default is an empty collection.

    Examples

    The below examples shows, how to add a collection of gradient stop to the bar pointer.

    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Axis>
            <gauge:LinearAxis>
                <gauge:LinearAxis.BarPointers>
                    <gauge:BarPointer Value="90"
                                      PointerSize="10"
                                      Background="Orange" 
                                      CornerStyle="BothCurve"
                                      Offset="-15">
                        <gauge:BarPointer.GradientStops>
                            <gauge:GaugeGradientStop Value="0"
                                                     Color="Green" />
                            <gauge:GaugeGradientStop Value="50"
                                                     Color="Orange" />
                            <gauge:GaugeGradientStop Value="100"
                                                     Color="Red" />
                        </gauge:BarPointer.GradientStops>
                    </gauge:BarPointer>
                </gauge:LinearAxis.BarPointers>
            </gauge:LinearAxis>
        </gauge:SfLinearGauge.Axis>
    </gauge:SfLinearGauge>

    Offset

    Gets or sets the value to adjusts the BarPointer position from the axis line.

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

    Its default value is 0.

    Remarks

    Specifies the distance between the pointer and the axis line. BarPointer rendered over the axis line by default.

    Examples
    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Axis>
            <gauge:LinearAxis>
                <gauge:LinearAxis.BarPointers>
                    <gauge:BarPointer Value="50"
                                      Offset="-15" />
                </gauge:LinearAxis.BarPointers>
            </gauge:LinearAxis>
        </gauge:SfLinearGauge.Axis>
    </gauge:SfLinearGauge>

    PointerSize

    Gets or sets the value that specifies the height of BarPointer for a horizontal linear gauge, or to the width of bar pointer for a vertical linear gauge.

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

    The size of the BarPointer, in pixels. The default value is 4.

    Examples
    <gauge:SfLinearGauge>
        <gauge:SfLinearGauge.Axis>
            <gauge:LinearAxis>
                <gauge:LinearAxis.BarPointers>
                    <gauge:BarPointer Value="50"
                                      PointerSize="30"
                                      Offset="-15" />
                </gauge:LinearAxis.BarPointers>
            </gauge:LinearAxis>
        </gauge:SfLinearGauge.Axis>
    </gauge:SfLinearGauge>

    Methods

    OnApplyTemplate()

    Invoke to render LinearGaugeRange class.

    Declaration
    protected override void OnApplyTemplate()

    OnCreateAutomationPeer()

    Declaration
    protected override AutomationPeer OnCreateAutomationPeer()
    Returns
    Type Description
    Microsoft.UI.Xaml.Automation.Peers.AutomationPeer
    Back to top Generated by DocFX
    Copyright © 2001 - 2022 Syncfusion Inc. All Rights Reserved