menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SliderChangeEventArgs<T> - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class SliderChangeEventArgs<T>

    Represents the event arguments for the Slider Change and Changed events.

    Inheritance
    System.Object
    SliderChangeEventArgs<T>
    Namespace: Syncfusion.Blazor.Inputs
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class SliderChangeEventArgs<T> : Object
    Type Parameters
    Name Description
    T

    The type of the slider value.

    Remarks

    This class provides comprehensive information about slider value changes, including the previous and current values, whether the change was initiated by user interaction, and additional metadata about the change event. The generic type parameter allows the slider to work with various value types such as int, double, or custom types.

    Examples

    Using SliderChangeEventArgs in a Blazor Slider component:

    <SfSlider @bind-Value="sliderValue" TValue="int" Min="0" Max="100">
        <SliderEvents TValue="int" ValueChange="OnSliderValueChange" />
    </SfSlider>
    
    @code {
        private int sliderValue = 30;
    
        private void OnSliderValueChange(SliderChangeEventArgs<int> args)
        {
            Console.WriteLine($"Previous: {args.PreviousValue}, Current: {args.Value}");
            Console.WriteLine($"User Initiated: {args.IsInteracted}");
        }
    }

    Constructors

    SliderChangeEventArgs()

    Declaration
    public SliderChangeEventArgs()

    Properties

    IsInteracted

    Gets or sets a value indicating whether the event was triggered by user interaction or programmatically.

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

    true if the event was initiated by user interaction (such as dragging or clicking); otherwise, false for programmatic changes.

    Remarks

    This property is useful for distinguishing between user-initiated changes and programmatic updates to the slider value. It allows developers to implement different logic based on the source of the value change, such as validation or custom behaviors.

    Name

    Gets or sets the action applied on the Slider.

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

    A string representing the name of the action performed on the slider. The default value is null.

    Remarks

    This property indicates the specific action that triggered the slider event, such as "drag", "click", or other slider interactions. It helps identify the type of user interaction that caused the value change.

    PreviousValue

    Gets or sets the previous value of the Slider before the change occurred.

    Declaration
    public T PreviousValue { get; set; }
    Property Value
    Type Description
    T

    The value of type T that was previously set on the slider. The default value is null.

    Remarks

    This property provides access to the slider's value before the current change event was triggered. It is particularly useful for implementing undo functionality, validation logic, or tracking value changes over time.

    Text

    Gets or sets the formatted text representation of the current slider value displayed in the tooltip.

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

    A string representing the formatted text of the slider value as it appears in the tooltip. The default value is null.

    Remarks

    This property contains the human-readable text representation of the slider value that is displayed in tooltips. The text may be formatted according to the slider's formatting options, culture settings, or custom formatting rules.

    Value

    Gets or sets the current value of the Slider after the change.

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

    The current value of type T representing the slider's new value. The default value is null.

    Remarks

    This property represents the new value that the slider has been changed to during the current event. It works in conjunction with PreviousValue to provide complete information about the value transition.

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