title: How to avoid Converters clashing with multibinding in WPF code behind
body: <p>I am creating WPF elements dynamically in code behind, and for each of the rows in the <code>Grid</code> I'm building it consists of a <code>CheckBox</code> and a Dynamic number of <code>TextBoxes</code>.  The interaction that is needed is the following:</p>
  
  <ul>
  <li>If all <code>TextBoxes</code> in a row have a value of <code>0</code>, set the <code>CheckBox</code>
  <code>IsChecked</code> property to <code>true</code> and Disable it. </li>
  <li>If one of the <code>TextBoxes</code> is then changed from <code>0</code>, enable the
  <code>CheckBox</code> and set <code>IsChecked</code> to <code>false</code>.</li>
  <li>If the user clicks on the <code>CheckBox</code>, set all associated <code>TextBoxes</code>
  to <code>0</code> and Disable the <code>CheckBox</code></li>
  </ul>
  
  <p>I was able to accomplish the first part of the last one using this code:</p>
  
  <pre><code>Binding setScoreToZeroIfIsNormalChecked = new Binding("IsChecked");
  setScoreToZeroIfIsNormalChecked.Source = this.NormalCheckBoxControl;
  setScoreToZeroIfIsNormalChecked.Converter = m_NormalCheckBoxJointScoresConverter;
  tempJointScoreControl.JointScoreContainer.SetBinding(ContainerBase.SingleAnswerProperty, setScoreToZeroIfIsNormalChecked);
  </code></pre>
  
  <p>and the converter:</p>
  
  <pre><code>public object Convert(object value, System.Type targetType, object parameter, System.Globalization.CultureInfo culture)
  {
      if (value is bool &amp;&amp; targetType == typeof(Answer))
      {
          if ((bool)value)
          {
              Answer answer = new Answer();
              answer.Value = "0";
              answer.DisplayValue = "0";
              return answer;
          }
          else
              return null;
      }
      else
      {
          return null;
      }
  }
  </code></pre>
  
  <p>However, in attempting to create another converter to accomplish other functionality, I was running into issues of converters stepping on one another since all functionality is based around the <code>CheckBox.IsChecked</code> property.</p>
  
  <p>Is there anyway to accomplish all of the above using one or two multibinding converters? I'd really like to avoid having to create a whole bunch of events and maintaining them in order to do this.</p>