title: WPF IDataErrorInfo validation after Value Conversion
body: <p>I've been searching around and it appears that <code>IDataErrorInfo</code> is currently the preferred method of input validation.</p>
  
  <p>Combining <code>IDataErrorInfo</code> with a value converter have proved a bit tricky to me. </p>
  
  <p>One question I asked my self, and in the end Google, was how to handle erroneous input in the Value Converter. A common practice appears to be to return the value unconverted in case of bad input. That makes a lot of sense since the view-model/model can validate the erroneous input and report back a more or less detailed description on what's wrong.</p>
  
  <p>I'm having one problem with this approach however. Let's try the following scenario:  </p>
  
  <ol>
  <li><p>I have a textbox bound to a property of type <code>decimal</code> which the user is supposed to input a price into.</p></li>
  <li><p>I have a value converter to transform the decimal point into a region specific decimal separator and round it to two decimals.</p></li>
  <li><p>The user enters <code>aa12.4</code> into the textbox.</p></li>
  </ol>
  
  <p>If my value converter returns <code>aa12.4</code> (because it's a erroneous value and not converted) it will be automatically converted to 0 when it is attached to the price property the text box is bound to. 0 (or 0.00) is a perfectly legal price which would validate to true.</p>
  
  <p>As you might understand i don't want <code>aa12.4</code> to be valid and magically transformed to 0. I also loose all means to determine what's specifically wrong with the input and report that back to the user.</p>
  
  <p>How do I handle this scenario? It's my understanding that the method handling the validation is called after the property is set. One idea I've read is to return <code>DependencyProperty.UnsetValue</code> from the converter. That on other hand does not help the validator to determine what was wrong with the input, just that it wasn't convertible.</p>