title: How to set a default value when produces an error using validation rules?
body: <p>I'm using Validation Rules to show custom messages, and INotifyDataError for the business rules.</p>
  
  <p>This one part of my code:</p>
  
  <pre><code>public class ResponseValidation : ValidationRule
  {
      public override ValidationResult Validate(object value, System.Globalization.CultureInfo cultureInfo)
      {
          int? response;
          bool noIllegalChars = TryParseStruct&lt;int&gt;(value.ToString(), out response);
  
  
          if (!noIllegalChars)
          {
              return new ValidationResult(false, "Input is not in a correct format.");
          }
          else
          {
              value = null;
              return new ValidationResult(true, null);
          }
      }
  
      ... 
  }
  </code></pre>
  
  <p>The validation is for a Nullable datatype, I mean the value can be null or an integer, but not an incorrect input like "5b".</p>
  
  <p>The question is when it produces this error (noIllegalChars = true), how can I set to the property the value null?</p>
  
  <p>EDIT: The reason which I'm doing this is because, when the user left the textbox empty (the value will be "") and technically, for the property that's a null value, but it's trying to set "" to the property.</p>