title: WPF TextBox setting red border on Validation
body: <p>I'm trying to make textbox's border red when it's empty. Here's my xaml:</p>
  
  <pre><code>     &lt;TextBox  Style="{StaticResource TextBoxEmptyError}" Name="tbFilename" Grid.Column="1" &gt;
           &lt;Binding Path="Text" UpdateSourceTrigger="PropertyChanged" NotifyOnValidationError="True"&gt;
              &lt;Binding.ValidationRules&gt;
                  &lt;local:EmptyRule /&gt;
              &lt;/Binding.ValidationRules&gt;
          &lt;/Binding&gt;
      &lt;/TextBox&gt;
  </code></pre>
  
  <p>style i'm trying to set:</p>
  
  <pre><code>        &lt;Style x:Key="TextBoxEmptyError" TargetType="{x:Type TextBox}"&gt;
              &lt;Style.Triggers&gt;
                  &lt;Trigger Property="Validation.HasError" Value="True"&gt;
                      &lt;Setter Property="BorderThickness" Value="2" /&gt;
                      &lt;Setter Property="BorderBrush" Value="Red" /&gt;
                  &lt;/Trigger&gt;
              &lt;/Style.Triggers&gt;
          &lt;/Style&gt;
  </code></pre>
  
  <p>EmptyRule:</p>
  
  <pre><code>public class EmptyRule : ValidationRule
      {
          public override ValidationResult Validate(object value, CultureInfo cultureInfo)
          {
              if (string.IsNullOrEmpty(value as string))
                  return new ValidationResult(false, null);
              else
                  return new ValidationResult(true, null);
  
          }
      }
  </code></pre>
  
  <p>In debugger it looks like Validation method isn't used at all.
  What am I doing wrong?</p>