menu

WinUI

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

    Show / Hide Table of Contents

    Class SliderLabelInfo

    It helps the user to display labels that associate a numeric value with major tick marks.

    Inheritance
    System.Object
    SliderLabelInfo
    Namespace: Syncfusion.UI.Xaml.Sliders
    Assembly: Syncfusion.Sliders.WinUI.dll
    Syntax
    public class SliderLabelInfo : Object
    Examples
    • XAML
    • C#
    public override List<SliderLabelInfo> GenerateVisibleLabels()
    {
        List<SliderLabelInfo> labelInfos = new List<SliderLabelInfo>();
        int minimum = (int)LogBase(this.Minimum, 10);
        int maximum = (int)LogBase(this.Maximum, 10);
        for (int i = minimum; i <= maximum; i++)
        {
            double value = Math.Floor(Math.Pow(10, i)); // logBase  value is 10
            SliderLabelInfo label = new SliderLabelInfo()
            {
                Value = value,
                Text = value.ToString()
            };
            labelInfos.Add(label);
        }
    
        labelsCount = labelInfos.Count;
        return labelInfos;
    }
    
    private double LogBase(double value, int baseValue)
    {
        return Math.Log(value) / Math.Log(baseValue);
    }

    Constructors

    SliderLabelInfo()

    Initializes a new instance of the SliderLabelInfo class.

    Declaration
    public SliderLabelInfo()
    Examples
    • XAML
    • C#
    public override List<SliderLabelInfo> GenerateVisibleLabels()
    {
        List<SliderLabelInfo> labelInfos = new List<SliderLabelInfo>();
        int minimum = (int)LogBase(this.Minimum, 10);
        int maximum = (int)LogBase(this.Maximum, 10);
        for (int i = minimum; i <= maximum; i++)
        {
            double value = Math.Floor(Math.Pow(10, i)); // logBase  value is 10
            SliderLabelInfo label = new SliderLabelInfo()
            {
                Value = value,
                Text = value.ToString()
            };
            labelInfos.Add(label);
        }
    
        labelsCount = labelInfos.Count;
        return labelInfos;
    }
    
    private double LogBase(double value, int baseValue)
    {
        return Math.Log(value) / Math.Log(baseValue);
    }

    Properties

    Text

    Gets or sets the text to display in label.

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

    It contains the string of the label.

    Value

    Gets or sets the value of the label.

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

    It contains the value of the label.

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