title: Textblock Style dataTrigger not working inside ItemsControl
body: <p>I have an <code>ObservableCollection&lt;Object1&gt;</code> type(<code>Messages</code> in code below) which is bound to an <code>ItemsControl</code>. Object1 is having two properties namely <code>ErrMsg</code> and <code>IsError</code>. I want to display the <code>ErrMsg</code> in red colour if its an Error(i.e. if <code>IsError</code> is true) otherwise Black.</p>
  
  <pre><code>&lt;ItemsControl
      Height="Auto"
      Background="White"
      ItemsSource="{Binding Messages}"&gt;
      &lt;ItemsControl.ItemTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;StackPanel&gt;
                  &lt;TextBlock
                      Margin="5,0,0,0"
                      Text="{Binding ErrMsg}"
                      Width="Auto"
                      Foreground="Black"&gt;
                      &lt;TextBlock.Style&gt;  
                          &lt;Style TargetType="{x:Type TextBlock}"&gt;       
                              &lt;Style.Triggers&gt;         
                                  &lt;DataTrigger
                                      Binding="{Binding IsError}"
                                      Value="true"&gt;      
                                      &lt;Setter
                                          Property="TextBlock.Foreground"
                                          Value="Red" /&gt;         
                                  &lt;/DataTrigger&gt;       
                              &lt;/Style.Triggers&gt;     
                          &lt;/Style&gt;   
                      &lt;/TextBlock.Style&gt; 
                  &lt;/TextBlock&gt;
              &lt;/StackPanel&gt;
          &lt;/DataTemplate&gt;
      &lt;/ItemsControl.ItemTemplate&gt;
  &lt;/ItemsControl&gt;
  </code></pre>
  
  <p>Problem is that all the messages are always displayed in Black colour irrespective of <code>IsError</code> value? </p>
  
  <p>How can I achieve this?</p>