title: Disable ValidatesOnDataErrors if CheckBox is Checked WPF
body: <p>I am trying to disable ValidatesOnDataErrors on a TextBox if a certain checkbox is checked. 
  I have tried placing a trigger on textbox to enable or disable validation based on the checkbox seems like the trigger gets hit but does not disable validation. I am using <strong>IDataErrorInfo</strong> for validation in the <strong>.cs</strong> code. Here is the code I have tried, this has been a headache so hope you can help. </p>
  
  <p><strong>.xaml</strong></p>
  
  <pre><code>&lt;TextBox Name="txtFoundERTReading" Height="23" Canvas.Left="125" TextWrapping="Wrap" Canvas.Top="136" Width="120"&gt;
      &lt;TextBox.Style&gt;                                
          &lt;Style TargetType="{x:Type TextBox}"&gt;                                    
              &lt;Style.Triggers&gt;
                  &lt;DataTrigger Binding="{Binding ElementName=cbFoundERTReading, Path=IsChecked}" Value="False"&gt;
                      &lt;Setter Property="Text" Value="{Binding Found.ERTReading, Mode=TwoWay, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}"&gt;&lt;/Setter&gt;
                  &lt;/DataTrigger&gt;
                  &lt;DataTrigger Binding="{Binding ElementName=cbFoundERTReading, Path=IsChecked}" Value="True"&gt;
                      &lt;Setter Property="TextBox.IsEnabled" Value="False" /&gt;
                      &lt;Setter Property="Text" Value="{Binding Found.ERTReading, Mode=TwoWay, ValidatesOnDataErrors=False, UpdateSourceTrigger=PropertyChanged}" /&gt;                                            
                  &lt;/DataTrigger&gt;
              &lt;/Style.Triggers&gt;
          &lt;/Style&gt;
      &lt;/TextBox.Style&gt;
  &lt;/TextBox&gt;
  </code></pre>