Getting Started with WPF Range Slider (SfRangeSlider)

This section describes how to design a SfRangeSlider control in a WPF application and overview of its basic functionalities.

Assembly deployment

Namespace:  Syncfusion.Windows.Controls.Input

Assembly:  Syncfusion.SfInput.WPF (in Syncfusion.SfInput.WPF.dll)

Dependent assembly: Syncfusion.SfShared.WPF.dll

Creating a simple application with SfRangeSlider

The SfRangeSlider control can be added to an application using Visual Studio.

Create the WPF application with SfRangeSlider control as follows:

  1. Creating project
  2. Adding control via designer
  3. Adding control manually in code

Creating the project

The steps to create a SfRangeSlider control by using Visual Studio in C# are as follows:

  1. Open Visual Studio.

  2. On the File menu, select New -> Project. This opens the New Project Dialog box.

Adding a control via designer

SfRangeSlider control can be added to the application by dragging it from the toolbox and dropping it in a designer view. The following required assembly references will be added automatically:

  • Syncfusion.SfInput.WPF
  • Syncfusion.SfShared.WPF

Tools

<editors:SfRangeSlider
                    Width="500"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Maximum="100"
                    Minimum="0"
                    Value="50" />

Adding a control manually in code

The following code sample shows how to create the SfRangeSlider from code-behind.

SfRangeSlider rangeSlider = new SfRangeSlider()
            {
                Width = 500,
                HorizontalAlignment = HorizontalAlignment.Center,
                VerticalAlignment = VerticalAlignment.Center,
                Minimum = 0,
                Maximum = 100,
                Value = 60
            };

RangeSlider