title: Changing colour of text in a textblock via a trigger
body: <p>Here is my Xaml </p>
  
  <pre><code> &lt;Window.Resources&gt;
      &lt;sampleData:MainWindow x:Key="DataSource"/&gt;
      &lt;DataTemplate x:Key="bobReferencer"&gt;                      
          &lt;TextBlock Text="{Binding Name}" &gt;
              &lt;TextBlock.Style&gt;
                  &lt;Style TargetType="TextBlock"&gt;
                      &lt;Style.Triggers&gt;
                          &lt;DataTrigger Binding="{Binding HasErrors}" Value="true"&gt;
                            //what goes in here?
                          &lt;/DataTrigger&gt;
                      &lt;/Style.Triggers&gt;
                  &lt;/Style&gt;
              &lt;/TextBlock.Style&gt;
          &lt;/TextBlock&gt;                                            
      &lt;/DataTemplate&gt;    
  &lt;/Window.Resources&gt;
  </code></pre>
  
  <p>Codebehind (the one xaml references)</p>
  
  <pre><code>public class bob
  {
  
      public string Name
      {
          get;
          set;
      }
  
      public bool HasErrors
      {
          get;
          set;
      }
   }
  </code></pre>
  
  <p>Basically what i want to do is if the HasErrors is true then i want the Name to appear in Red via the trigger. But my xaml is not properly formed. Any suggestions on this?  I also looked into this link but didn't help much.<br>
  <a href="https://stackoverflow.com/questions/13914943/how-can-i-change-the-foreground-color-of-a-textblock-with-a-trigger">How can I change the Foreground color of a TextBlock with a Trigger?</a></p>