title: Make a slider use an existing IValueConverter
body: <p>I have a <a href="https://github.com/nicolas-raoul/CmisSync/blob/master/CmisSync/Windows/PollIntervalSlider.cs" rel="nofollow">slider</a> implementing <a href="http://msdn.microsoft.com/en-us/library/system.windows.controls.slider%28v=vs.110%29.aspx" rel="nofollow">System.Windows.Controls.Slider</a>:</p>
  
  <pre><code>class MySlider : Slider
  {
      public MySlider()
      {
          Minimum = 1;
          Maximum = 1000;
      }
  }
  </code></pre>
  
  <p>I use it like this: <code>MySlider slider = new MySlider() { Width = 400, Name = "TheSlider"};</code></p>
  
  <p>It works well, but it is linear.<br>
  I want to make it <strong>non-linear</strong> because sensible values are like 1, 2, 10, 1000 (for instance).<br>
  So I defined a non-linear <a href="http://msdn.microsoft.com/en-us/library/system.windows.data.ivalueconverter%28v=vs.110%29.aspx" rel="nofollow">IValueConverter</a> like this:</p>
  
  <pre><code>public class LogScaleConverter : IValueConverter
  {
      public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
      {
          return (int)Math.Log((int)value);
      }
  
      public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
      {
          return (int)Math.Exp((double)value);
      }
  }
  </code></pre>
  
  <p><strong>QUESTION:</strong> How to make the <strong>slider</strong> use this <strong>converter</strong>?</p>