How should the xamNumeric Slider be configured to ensure that the thumb snaps to integer values? I have configure the XAML as follows:
<ig:XamNumericSlider MaxValue="10" MinValue="1" Value="5"><ig:XamNumericSlider.TickMarks><ig:SliderTickMarks TickMarksFrequency="1" IncludeSliderEnds="True"/></ig:XamNumericSlider.TickMarks></ig:XamNumericSlider>
Also, is it possible to add labels to the tick marks to show the slider value at a particular tick mark?
Hi Matt,
I am glad that you have found a solution to your issue; this is certainly an effective way of snapping the thumb to an tick mark integer value.
There is also a property extended from the Thumb of the XamNumericSlider, which will handle this logic for you, which I have described in the following example.
<ig:XamNumericSlider.Thumb> <ig:XamSliderNumericThumb IsSnapToTickEnabled="True"> </ig:XamSliderNumericThumb></ig:XamNumericSlider.Thumb>
I have also constructed and attached a sample which demonstrates this behavior for further context.
If you have any further questions, please let me know.
Sincerely,Chris KDeveloper Support EngineerInfragistics, Inc.www.infragistics.com/support
Never mind I answered my own question. For anyone else who wants to know, just handle the ThumbValueChanged event and round:
private void MySlider_ThumbValueChanged(object sender, Infragistics.Controls.Editors.ThumbValueChangedEventArgs<double> e){ if (e.NewValue != Math.Round(e.NewValue)) ImpactSlider.Value = Math.Round(e.NewValue); }