Articles in this section
Category / Section

How to set LargeChange and SmallChange properties in WPF RangeSlider?

2 mins read

The LargeChange and SmallChange are attached properties of the SfRangeSlider that specifies the distance of a thumb to be moved when the SfRangeSlider bar is clicked. The default value of LargeChange and SmallChange is 1.

To set the LargeChange and SmallChange properties for the SfRangeSlider, you need to add the SnapsTo and MoveToPoint properties of the SfRangeSlider.

How to set the SmallChange property for the SfRangeSlider 

To set the SmallChange property for the SfRangeSlider, the SnapsTo value should be set as StepValues and MoveToPoint should be set as IncrementBySmallChange. So, the range of the SfRangeslider adds or subtracts the SmallChange from the value of the SfRangeSlider.

You can refer to the following code example.

XAML

//The code explains how to use the SmallChange property for the SfRangeSlider
<Window x:Class="SfRangeSlider.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
        Title="MainWindow" Height="350" Width="525">
<Grid Name="grid1">
StackPanel  Orientation="Vertical">
            <TextBlock Text="SmallChange" Width="150" ></TextBlock>
            <syncfusion:SfRangeSlider SmallChange="2" Value="10" SnapsTo="StepValues"  MoveToPoint="IncrementBySmallChange" Width="300" Height="100" />
</StackPanel>
</Grid>
</Window>

 

C#

//The code explains how to use the SmallChange property for the SfRangeSlider
public MainWindow()
        {
            InitializeComponent();
                        StackPanel stack1 = new StackPanel();
            stack1.Orientation = Orientation.Vertical;
            TextBlock Text1 = new TextBlock();
            Text1.Text = "SmallChange";
            Text1.Width = 150;
            SfRangeSlider RangeSlider = new SfRangeSlider();
            RangeSlider.Width = 300;
            RangeSlider.Height = 100;
            RangeSlider.Value = 10;
            RangeSlider.SnapsTo = SliderSnapsTo.StepValues;
            RangeSlider.MoveToPoint = MovePoint.IncrementBySmallChange;
            RangeSlider.SmallChange = 2;
            stack1.Children.Add(Text1);
            stack1.Children.Add(RangeSlider);
            grid1.Children.Add(stack1);
             }

 

How to set the LargeChange property for the SfRangeSlider

To set the Largechange for the SfRangeSlider, the SnapsTo value should be set as StepValues and MoveToPoint should be set as IncrementByLargeChange. So, the range of the SfRangeslider adds or subtracts the LargeChange from the value of the SfRangeSlider.

You can refer to the following code example.

XAML

//Code explains how to use the LargeChange property for the SfRangeSlider.
<Window x:Class="SfRangeSlider.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
        Title="MainWindow" Height="350" Width="525">
<Grid Name="grid1">
<StackPanel>
            <TextBlock Text="LargeChange" Width="150" ></TextBlock>
            <syncfusion:SfRangeSlider LargeChange="3" Value="10" SnapsTo="StepValues"   MoveToPoint="IncrementByLargeChange" Width="300" Height="100" />
</StackPanel>
</Grid>
</Window>

 

C#

//Code explains how to use the LargeChange property for the SfRangeSlider.
public MainWindow()
        {
            InitializeComponent();
            StackPanel stack1 = new StackPanel();
            stack1.Orientation = Orientation.Vertical;
            TextBlock Text1 = new TextBlock();
            Text1.Text = "LargeChange";
            Text1.Width = 150;
            SfRangeSlider RangeSlider = new SfRangeSlider();
            RangeSlider.Width = 300;
            RangeSlider.Height = 100;
            RangeSlider.Value = 10;
            RangeSlider.SnapsTo = SliderSnapsTo.StepValues;
            RangeSlider.MoveToPoint = MovePoint.IncrementByLargeChange;
            RangeSlider.LargeChange= 3;
            stack1.Children.Add(Text1);
            stack1.Children.Add(RangeSlider);
            grid1.Children.Add(stack1);
        }

 


Conclusion

I hope you enjoyed learning about how to set LargeChange and SmallChange properties in WPF Range Slider.

You can refer to our WPF Range Slider feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our WPF Range Slider example to understand how to create and manipulate data.


For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied