It is straightforward to remap the linear values returned by a WPF slider control:
public double Multiplier
{
get
{
switch ((int)sliderMultiplier.Value)
{
case 0: return 0.1;
case 1: return 0.2;
case 2: return 0.5;
case 3: return 1;
case 4: return 2;
case 5: return 5;
case 6: return 10;
default: throw new ArgumentOutOfRangeException();
}
}
}
But the slider handle, while being dragged, is accompanied by a tooltip showing the selected value - the unmapped linear value. How can I supply the remapped value for display? Or get the slider to supply non-linear values directly?
Somebody else has solved this (as far as the tooltips are concerned). Couldn't find a way of having the slider itself actually report a non-linear value range.
http://joshsmithonwpf.wordpress.com/2007/09/14/modifying-the-auto-tooltip-of-a-slider/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With