title: WPF change progressbar foreground colour
body: <p>I am working with the progressbar and I am trying to find a way of setting the foreground colour to red if the showError variable (bool) in the label below it is true. I can set the foreground colour based on the progress bar value using a data trigger, as shown below but I cannot capture the value in the showError variable. Anybody managed to do this?</p>
  
  <pre><code>    &lt;ProgressBar Maximum="{Binding Max}" Minimum="{Binding Min}" Name="progressBar" Value="{Binding Path=Value}" &gt;
          &lt;ProgressBar.Resources&gt;
              &lt;Style TargetType="{x:Type ProgressBar}"&gt;
                  &lt;Style.Triggers&gt;
                      &lt;DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Value}" Value="10"&gt;
                          &lt;Setter Property="Foreground" Value="Blue"/&gt;
                      &lt;/DataTrigger&gt;
                  &lt;/Style.Triggers&gt;
              &lt;/Style&gt;
          &lt;/ProgressBar.Resources&gt;
      &lt;/ProgressBar&gt;
      &lt;Label Visibility="{Binding Path=ShowError, Converter={StaticResource booleanToVisibilityConverter}}" Content="Service was not available" Height="28" HorizontalAlignment="Left" Margin="408,238,0,0" Name="label2"/&gt;
  </code></pre>