title: WPF: How do I set the Foreground property of a TextBlock using DataTrigger
body: <p>This is my XAML:</p>
  
  <pre><code>&lt;TextBlock Name="SeverityText"
             Grid.Column="1"
             Grid.Row="0"
             Foreground="Red"&gt;
      &lt;TextBlock.Triggers&gt;
  
          &lt;DataTrigger Binding="{Binding Path=Severity}"&gt;
              &lt;DataTrigger.Value&gt;
                  &lt;sm:Severity&gt;Warning&lt;/sm:Severity&gt;
              &lt;/DataTrigger.Value&gt;
              &lt;Setter TargetName="SeverityText"
                      Property="Foreground"
                      Value="Yellow" /&gt;
          &lt;/DataTrigger&gt;
                   &lt;DataTrigger Binding="{Binding Path=Severity}"&gt;
              &lt;DataTrigger.Value&gt;
                  &lt;sm:Severity&gt;Information&lt;/sm:Severity&gt;
              &lt;/DataTrigger.Value&gt;
              &lt;Setter TargetName="SeverityText"
                      Property="Foreground"
                      Value="White" /&gt;
          &lt;/DataTrigger&gt;
  
  
      &lt;/TextBlock.Triggers&gt;
      &lt;TextBlock&gt;Severity:&lt;/TextBlock&gt;
      &lt;TextBlock Text="{Binding Path=Severity}" /&gt;
  &lt;/TextBlock&gt;
  </code></pre>
  
  <p>This is my error message:</p>
  
  <blockquote>
    <p>Cannot find the static member 'ForegroundProperty' on the type 'ContentPresenter'.</p>
  </blockquote>
  
  <p>sm:Severity is an enumeration I imported.</p>