Reputation: 3768
How I can get step (0.5) in slider control in WP7?
It can change values like 0.5-1.0-1.5-2.0...
Upvotes: 3
Views: 3376
Reputation: 141638
Set the SmallChange
and LargeChange
properties to 0.5
. Like this:
<Slider x:Name="Slider" SmallChange="0.5" LargeChange="0.5" />
In addition, you can handle the ValueChanged
event like so:
private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
Slider.Value = Math.Round(e.NewValue * 2) /2;
}
Upvotes: 8