WPF non-linear slider values

Directly override linear values ​​returned by 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, when dragged, is accompanied by a tooltip showing the selected value — an unchanged linear value. How can I provide a re-rendered value to be displayed? Or get a slider to feed non-linear values ​​directly?

+3


source to share


1 answer


Someone else solved this (as far as tooltips are concerned). Couldn't find a way to get the slider itself to report a range of non-linear values.



http://joshsmithonwpf.wordpress.com/2007/09/14/modifying-the-auto-tooltip-of-a-slider/

+1


source







All Articles