3
votes

I'm working on a windows phone 8.1 application with some sliders for various settings.

I would like to know if it is possible to only allow a user to drag the slider to change it's value. I do not want the value of the slider to change when the user taps an area away from the slider thumb (eg jump to the tapped point).

I have tried to set IsTapEnabled to false https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.uielement.istapenabled.ASPx

I have poured through the slider xaml documentation https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.slider

I still cant seem to disable 'tap change value' of the slider. Any insight is greatly appreciated!

1
I dont think you can change that behavior, why dont you try do add a handler that detect if the current value and the changed value is more than a certain number, for example if now is 5 and selected value is 20, then roll back the value to 5.Ganesh Cauda

1 Answers

0
votes

Make a copy of the slider template and set IsHitTestVisible to False for the elements with the following names:

  • HorizontalTrackRect
  • HorizontalDecreaseRect
  • HorizontalBorder
  • VerticalTrackRect
  • VerticalDecreaseRect
  • VerticalBorder

That should work.