title: WPF - Dynamic value in ConverterParameter
body: <p>Got a situation where checkboxes in a UI need to be bound to a numeric parameter - effectively, certain values make the checkbox "true", otherwise it's "false".</p>
  
  <p>Easiest way to do this seemed to be to use a converter:</p>
  
  <pre><code>[ValueConversion(typeof(int), typeof(bool?))]
  public class TypeToBoolConverter : IValueConverter
  {
      public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
      {
          if (targetType != typeof(bool?))
              throw new InvalidOperationException("The target must be a bool");
  
          if( (value &lt; 3)
          {
              return true;
          }
          return false;
      }
  
      public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
      {
          throw new NotImplmentedExpection();
      }
  }
  </code></pre>
  
  <p>And then in the XAML:</p>
  
  <pre><code>&lt;CheckBox IsChecked="{Binding Path=Type.TypeID, Converter={StaticResource TypeConverter}}" /&gt;
  </code></pre>
  
  <p>Which works like a charm when using Convert, but fails utterly when using ConvertBack because it needs to know what the numeric value was (it depends on other UI elements) before it can know what number to return - effectively it needs access to the bound object.</p>
  
  <p>I assumed I could do this with a ConverterParameter, but from the looks of things you can't bind a value to this property. </p>
  
  <p>Is there a way out of this mess?</p>
  
  <p>EDIT: I have solved this by messing around with the original bindings, and got away with it because on uncheck all I want to do is delete the item anyway. But I'm going to leave this in place since it seems a valid issue and I'm curious about possible solutions.</p>