alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class SliderColorRanges

    Specifies the collection of color ranges for the slider track, allowing multiple colors to be applied to different segments based on start and end values.

    Inheritance
    object
    ComponentBase
    OwningComponentBase
    SfOwningComponentBase
    SliderColorRanges
    Implements
    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    Inherited Members
    ComponentBase.Assets
    ComponentBase.AssignedRenderMode
    ComponentBase.DispatchExceptionAsync(Exception)
    ComponentBase.InvokeAsync(Action)
    ComponentBase.InvokeAsync(Func<Task>)
    ComponentBase.OnAfterRender(bool)
    ComponentBase.OnInitialized()
    ComponentBase.OnInitializedAsync()
    ComponentBase.OnParametersSet()
    ComponentBase.OnParametersSetAsync()
    ComponentBase.RendererInfo
    ComponentBase.SetParametersAsync(ParameterView)
    ComponentBase.ShouldRender()
    ComponentBase.StateHasChanged()
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    OwningComponentBase.IsDisposed
    OwningComponentBase.ScopedServices
    Namespace: Syncfusion.Blazor.Inputs
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class SliderColorRanges : SfOwningComponentBase, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
    Remarks

    The SliderColorRanges component enables you to apply different colors to specific segments of the slider track. Each color range is defined by a start and end value, allowing for visually distinct sections within the slider. This component must be used as a child component within a slider control and contains multiple SliderColorRanges items.

    Examples
    <SfSlider @bind-Value="SliderValue" Min="0" Max="100" Step="1">
        <SliderColorRanges>
            <SliderColorRange Color="#ff0000" Start="0" End="25"></SliderColorRange>
            <SliderColorRange Color="#ffff00" Start="25" End="50"></SliderColorRange>
            <SliderColorRange Color="#00ff00" Start="50" End="75"></SliderColorRange>
            <SliderColorRange Color="#0000ff" Start="75" End="100"></SliderColorRange>
        </SliderColorRanges>
    </SfSlider>

    Constructors

    SliderColorRanges()

    Declaration
    public SliderColorRanges()

    Methods

    BuildRenderTree(RenderTreeBuilder)

    Declaration
    protected override void BuildRenderTree(RenderTreeBuilder __builder)
    Parameters
    Type Name Description
    RenderTreeBuilder __builder
    Overrides
    ComponentBase.BuildRenderTree(RenderTreeBuilder)

    Dispose(bool)

    Releases the unmanaged resources used by the component and optionally releases the managed resources.

    Declaration
    protected override void Dispose(bool disposing)
    Parameters
    Type Name Description
    bool disposing

    true to release both managed and unmanaged resources; false to release only unmanaged resources.

    Overrides
    OwningComponentBase.Dispose(bool)
    Remarks

    This method performs cleanup operations when the component is being disposed. It clears references to the parent slider and the color range collection to prevent memory leaks. The base implementation is called to ensure proper disposal of inherited resources.

    OnAfterRenderAsync(bool)

    Method invoked after each time the component has been rendered.

    Declaration
    protected override Task OnAfterRenderAsync(bool firstRender)
    Parameters
    Type Name Description
    bool firstRender

    Set to true for the first time component rendering; otherwise gets false.

    Returns
    Type Description
    Task

    A Task representing the asynchronous operation.

    Overrides
    ComponentBase.OnAfterRenderAsync(bool)
    Remarks

    This method is called after the component has been rendered. On the first render, it updates the parent slider component with the color range configuration. This ensures that the parent slider component receives the color range data and can apply the appropriate styling to the track segments.

    Implements

    IComponent
    IHandleEvent
    IHandleAfterRender
    IDisposable
    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved