Hi,
I've configured a slider in order to select a value between ZERO and ONE which can have maximum 2-digit after ZERO. I've attached a sample project and a video in order to explain my problems:
1. I didn't change the original thumb style but still the ticks and the thumb's arrow doesn't align correctly. There is a slight difference. May be it's because of my tick configuration. Can you check it out?
2. Second problem is a weird one: As you can see in the video I bind a TextBox to the thumbs Value property in order to show the current value. But after 0.8 it starts to show values like 0.8400000000000001.
Can you check out the sample project? May be my configurations are wrong.
Thanks in advance
Hello,
I apologize that your post has not been answered by an Infragistics employee.
Regarding issue 1 :
What you can do is set the RenderTransform property on the Thumb and adjust it so that it aligns with tickmark. I believe the slider is using the left side of the thumb and the left side of the tickmark to determine the current value of the slider.
<ig:XamSliderNumericThumb ...>
<ig:XamSliderNumericThumb.RenderTransform>
<TranslateTransform X="-3"/>
</ig:XamSliderNumericThumb.RenderTransform>
</ig:XamSliderNumericThumb>
Regarding issue 2 : I am not sure if we should be rounding up the value but it is strange that it changes after a specific value. We will take a look at this as a potential issue. What you could do is to set the StringFormat property of the binding of the TextBlock, like so :
Text="{Binding ElementName=sliderThumbValue, Path=Value,StringFormat=###.##}"
Thanks for the reply!
Your solution for the first issue worked. Thanks.
For the second issue, I also formatted the value in TextBlock but I wanted to inform you about the problem.
Thanks again
The incorrect precision of the value issue is logged with reference number 37054 in case anyone else encounters this.