WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class LinearLabelTick

    Show / Hide Table of Contents

    Class LinearLabelTick

    Represents the numeric Label ticks of the linear scale.

    Inheritance
    System.Object
    GaugeElement
    TickBase
    LinearLabelTick
    Inherited Members
    TickBase.AngleProperty
    TickBase.DistanceFromScaleProperty
    TickBase.TickPlacementProperty
    TickBase.TickStyleProperty
    TickBase.YDistanceFromScaleProperty
    TickBase.RangedBrushProperty
    TickBase.RangedBrushStartValueProperty
    TickBase.RangedBrushEndValueProperty
    TickBase.OnAngleChanged(DependencyPropertyChangedEventArgs)
    TickBase.OnDistanceFromScaleChanged(DependencyPropertyChangedEventArgs)
    TickBase.OnTickPlacementChanged(DependencyPropertyChangedEventArgs)
    TickBase.OnTickStyleChanged(DependencyPropertyChangedEventArgs)
    TickBase.Angle
    TickBase.DistanceFromScale
    TickBase.TickPlacement
    TickBase.TickStyle
    TickBase.YDistanceFromScale
    TickBase.RangedBrush
    TickBase.RangedBrushStartValue
    TickBase.RangedBrushEndValue
    TickBase.AngleChanged
    TickBase.DistanceFromScaleChanged
    TickBase.TickPlacementChanged
    TickBase.TickStyleChanged
    GaugeElement.BackgroundBrushProperty
    GaugeElement.BorderBrushProperty
    GaugeElement.BorderWidthProperty
    GaugeElement.BackgroundBrush
    GaugeElement.BorderBrush
    GaugeElement.BorderWidth
    Namespace: Syncfusion.Windows.Gauge
    Assembly: Syncfusion.Gauge.WPF.dll
    Syntax
    public class LinearLabelTick : TickBase
    Remarks

    The LinearLabelTick can made to display Labels for either the MajorTick or MinorTick. The Ticks to which the labels are placed is set by using the TickStyle property.

    Examples
    
    
    
    
    
    
     
    
    
    
    
    
    
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows;
    using System.Windows.Media;
    using System.Windows.Controls;
    using System.Windows.Data;
    using Syncfusion.Windows.Shared;
    using Syncfusion.Windows.Gauge;

    namespace LinearLabelTickSample { public partial class Window1 : Window { private LinearGauge linearGauge1; public Window1() { InitializeComponent();

    linearGauge1 = new LinearGauge(); this.linearGauge1.CenterFrameFillColor = Colors.Brown;

    LinearScale scale = new LinearScale(); scale.Minimum = 0; scale.Maximum = 100; scale.MinorIntervalValue = 2; scale.MajorIntervalValue = 10; scale.ScaleBarSize = 20; scale.ScaleBarLength = 260; linearGauge1.Scales.Add(scale);

    LinearLabelTick labelTick = new LinearLabelTick(); labelTick.FontSize = 10; labelTick.TickStyle = TickStyle.MajorTick; labelTick.BackgroundBrush = new SolidColorBrush(Colors.GhostWhite); labelTick.TickPlacement = ScalePlacement.Inside; labelTick.DistanceFromScale = 5; scale.Ticks.Add(labelTick);

    this.Content = linearGauge1; } } }

    Constructors

    LinearLabelTick()

    Initializes a new instance of the LinearLabelTick class.

    Declaration
    public LinearLabelTick()

    Fields

    CalculateFormulaProperty

    Identifies the CalculateFormula dependency property.

    Declaration
    public static readonly DependencyProperty CalculateFormulaProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    FontFamilyProperty

    Identifies the FontFamily dependency property.

    Declaration
    public static readonly DependencyProperty FontFamilyProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    FontSizeProperty

    Identifies the FontSize dependency property.

    Declaration
    public static readonly DependencyProperty FontSizeProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    FontWeightProperty

    Identifies the FontWeight dependency property.

    Declaration
    public static readonly DependencyProperty FontWeightProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    IncludeFirstValueProperty

    Identifies the IncludeFirstValue dependency property.

    Declaration
    public static readonly DependencyProperty IncludeFirstValueProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    IsCalculateFormulaEnabledProperty

    Identifies the IsCalculateFormulaEnabled dependency property.

    Declaration
    public static readonly DependencyProperty IsCalculateFormulaEnabledProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    IsLogarithmicProperty

    Identifies the IsLogarithmic dependency property.

    Declaration
    public static readonly DependencyProperty IsLogarithmicProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    IsRelativeAngleProperty

    Identifies the IsRelativeAngle dependency property.

    Declaration
    public static readonly DependencyProperty IsRelativeAngleProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    LogBaseProperty

    Identifies the LogBase dependency property.

    Declaration
    public static readonly DependencyProperty LogBaseProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    NumberFormatInfoProperty

    Identifies the NumberFormatInfo dependency property.

    Declaration
    public static readonly DependencyProperty NumberFormatInfoProperty
    Field Value
    Type Description
    System.Windows.DependencyProperty

    Properties

    CalculateFormula

    Gets or sets the Formula string that can be used to calculate the label values. This is a dependency property.

    Declaration
    public string CalculateFormula { get; set; }
    Property Value
    Type Description
    System.String

    Type: System.String Default CalculateFormula is string.Empty.

    See Also
    IsCalculateFormulaEnabled

    FontFamily

    Gets or sets the font family for the labels. This is a dependency property.

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

    Type: FontFamily

    FontSize

    Gets or sets the font size for the labels. This is a dependency property.

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

    Type: System.Double Default value is 10.

    FontWeight

    Gets or sets the font weight for the labels. This is a dependency property.

    Declaration
    public FontWeight FontWeight { get; set; }
    Property Value
    Type Description
    System.Windows.FontWeight

    Type: FontWeight

    IncludeFirstValue

    Gets or sets a value indicating whether to include first tick value. This is a dependency property.

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

    Type: System.Boolean

    IsCalculateFormulaEnabled

    Gets or sets a value indicating whether IsCalculateFormula value is true or false, so that label values calculated using a formula were displayed on the scale.This is a dependency property.

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

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

    See Also
    CalculateFormula

    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

    IsRelativeAngle

    Gets or sets a value indicating whether the label's angle is relative to that of the scale's angle

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

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

    See Also
    CalculateFormula

    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

    NumberFormatInfo

    Gets or sets the Custom's NumberFormatInfo value This is a dependency property.

    Declaration
    public NumberFormatInfo NumberFormatInfo { get; set; }
    Property Value
    Type Description
    System.Globalization.NumberFormatInfo

    Type: System.Globalization.NumberFormatInfo Default value is "null".

    Methods

    MeasureOverride(Size)

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

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

    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

    The measuring is done by calculating the width and height of the scale's Maximum value's size, assuming Maximum label will always have the highest width and height

    OnCalculateFormulaChanged(DependencyPropertyChangedEventArgs)

    Updates property value cache and raises CalculateFormulaChanged event.

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

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

    OnIncludeFirstValueChanged(DependencyPropertyChangedEventArgs)

    Updates property value cache and raises IncludeFirstValueChanged event.

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

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

    OnInitialized(EventArgs)

    Raises the System.Windows.FrameworkElement.Initialized event. This method is invoked whenever System.Windows.FrameworkElement.IsInitialized property is set to true internally.

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

    The System.EventArgs that contains the event data.

    OnIsCalculateFormulaEnabled(DependencyPropertyChangedEventArgs)

    Updates property value cache and raises IsCalculateFormulaEnabledChanged event.

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

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

    OnIsLogarithmicChanged(DependencyPropertyChangedEventArgs)

    Updates property value cache and raises IsLogarithmicChanged event.

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

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

    OnIsRelativeAngleChanged(DependencyPropertyChangedEventArgs)

    Updates property value cache and raises IsRelativeAngleChanged event.

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

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

    OnLogBaseChanged(DependencyPropertyChangedEventArgs)

    Updates property value cache and raises LogBaseChanged event.

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

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

    OnNumberFormatInfoChanged(DependencyPropertyChangedEventArgs)

    Updates property value cache and raises NumberFormatInfoChanged event.

    Declaration
    protected virtual void OnNumberFormatInfoChanged(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

    • ratiostores the number of segments(relative to Maximum and Minimum values), that can be formed,each of "valueInterval" length.
    • intervalStores the length of one such segment(relative to ScaleBarLength deducting YDistanceFromScale).

    • IsLogarithmicBoolean value to denote whether the label displays values in Log or in Normal decimal form
    • LogBaseDouble value which stores the base value for logarithmic display of labels

    Events

    CalculateFormulaChanged

    Event that is raised when CalculateFormula property is changed.

    Declaration
    public event PropertyChangedCallback CalculateFormulaChanged
    Event Type
    Type Description
    System.Windows.PropertyChangedCallback

    IncludeFirstValueChanged

    Event that is raised when IncludeFirstValue property is changed.

    Declaration
    public event PropertyChangedCallback IncludeFirstValueChanged
    Event Type
    Type Description
    System.Windows.PropertyChangedCallback

    IsCalculateFormulaEnabledChanged

    Event that is raised when IsCalculateFormulaEnabled property is changed.

    Declaration
    public event PropertyChangedCallback IsCalculateFormulaEnabledChanged
    Event Type
    Type Description
    System.Windows.PropertyChangedCallback

    IsLogarithmicChanged

    Event that is raised when IsLogarithmic property is changed.

    Declaration
    public event PropertyChangedCallback IsLogarithmicChanged
    Event Type
    Type Description
    System.Windows.PropertyChangedCallback

    IsRelativeAngleChanged

    Event that is raised when IsRelativeAngle property is changed.

    Declaration
    public event PropertyChangedCallback IsRelativeAngleChanged
    Event Type
    Type Description
    System.Windows.PropertyChangedCallback

    LogBaseChanged

    Event that is raised when LogBase property is changed.

    Declaration
    public event PropertyChangedCallback LogBaseChanged
    Event Type
    Type Description
    System.Windows.PropertyChangedCallback

    NumberFormatInfoChanged

    Event that is raised when NumberFormatInfo property is changed.

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