I have the following code for a slider control in WPF:
occuranceTimeSlider.TickPlacement = System.Windows.Controls.Primitives.TickPlacement.BottomRight;
occuranceTimeSlider.IsSnapToTickEnabled = true;
occuranceTimeSlider.Ticks = new DoubleCollection()
{
30, 45, 60, 90, 120, 180, 240, 300, 600, 900, 1200, 1800, 3600, 5400, 7200, 9000, 10800, 14400, 18000
};
occuranceTimeSlider.Minimum = occuranceTimeSlider.Ticks.Min();
occuranceTimeSlider.Maximum = occuranceTimeSlider.Ticks.Max();
occuranceTimeSlider.IsSelectionRangeEnabled = false ;
At runtime, the slider displays and works almost correctly. The ticks are placed with a variable distance between each tick, based on the size of the two ticks. For example, the tick distance between 14400 and 18000 is much larger than the tick distance between 30 and 45. Is there any way to make this distance constant?
Thanks
The only way I can think of (short of re-templating the slider) would be to translate from fixed numbers to your exponential scale behind the scenes. As long as you’ve configured the slider such that it never displays the numbers, your users will never know.