title: C# binding not working
body: <p>I have implemented a basic data binding in code behind, this is the code:</p>
  
  <pre><code>Binding bindingSlider = new Binding();
  bindingSlider.Source = mediaElement.Position;
  bindingSlider.Mode = BindingMode.TwoWay;            
  bindingSlider.Converter = (IValueConverter)Application.Current.Resources["DoubleTimeSpan"];            
  slider.SetBinding(Slider.ValueProperty, bindingSlider);
  </code></pre>
  
  <p>And this is the converter's code,</p>
  
  <pre><code>class DoubleTimeSpan : IValueConverter
      {
          public object Convert(object value, Type targetType, object parameter,
  string language)
      {
          return ((TimeSpan)value).TotalSeconds;
      }
  
      public object ConvertBack(object value, Type targetType, object parameter,
  string language)
      {           
          return TimeSpan.FromSeconds((double)value);
      }
  }
  </code></pre>
  
  <p>Even though I don't receive compiler's error message, but the binding code is not working. Why?</p>