title: WPF IDataErrorInfo and NHibernate Validation - how to trigger a Validate?
body: <p>I recently plugged the NHibernate validation into my app, I've decorated the properties of my domain objects with the NHibernate attributes as so ...</p>
  
  <pre><code>    [NotEmpty, Length(Min = 1, Max = 40)]
      public string Description { get; set; }
  </code></pre>
  
  <p>I've also implemented IDataErrorInfo on my Domain Object  ...</p>
  
  <pre><code>    public string this[string columnName]
      {
          get
          {
              var result = new ValidatorEngine().Validate(this);
              _invalidValues = result.Where(x =&gt; x.PropertyName == columnName).Select(x =&gt; x.Message);
              return _invalidValues.FirstOrDefault();
          }
  
      }
  
      public string Error
      {
          get
          {
              return string.Empty;
          }
      }
  </code></pre>
  
  <p>The XAML looks like this</p>
  
  <pre><code> &lt;TextBox Grid.Row="0" Grid.Column="3" Text="{Binding Path=Entity.Description, UpdateSourceTrigger=PropertyChanged, ValidatesOnDataErrors=True}" IsEnabled="{Binding IsEditable}" &gt;&lt;/TextBox&gt;
  </code></pre>
  
  <p>My issue is that when I create a new instance of my Domain object then the validate is not being called, as effectively the properties (such as the Description in my example) have not changed.  </p>
  
  <p>I was going to write a method to use reflection and set the properties to what they are already equal to in order to trigger the validate, but this dosnt seem a particularly efficient approach!!  </p>
  
  <p>Can someone put me back on track please?</p>
  
  <p>Cheers,</p>
  
  <p>Andy</p>