title: WPF Ignoring ProgressBar Style
body: <p>Following a problem in WPF 4 where the default <code>ProgressBar</code> template has an off-white highlight applied causing it to dull the foreground colour, I decided to extract the template and manually edit the values to white.</p>
  
  <p>After doing this, I put the template as a style in App.xaml for global use and the Visual Studio designer began to use it right away.</p>
  
  <p>However, when I run my app, the default style is still being applied:</p>
  
  <p><a href="https://i.stack.imgur.com/owMMP.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/owMMP.png" alt="Top - Application, Bottom - Designer"></a><br>
  <sub>(source: <a href="http://www.nidonocu.com/temp_images/progress_problem.png" rel="nofollow noreferrer">nidonocu.com</a>)</sub>  </p>
  
  <p>I then tried setting the style specifically using a key, then even having it as an inline style and finally as a inline template without a wrapping style for the specific progress bar and it is still ignored.</p>
  
  <p>What's going wrong?</p>
  
  <p>Current code for the <code>ProgressBar</code>:</p>
  
  <pre><code> &lt;ProgressBar Grid.Column="1"
                Grid.Row="2"
                Height="15"
                Width="355"
                Margin="0,0,0,7"
                IsIndeterminate="{Binding ProgressState, FallbackValue=False}"
                Visibility="{Binding ProgressVisibility, FallbackValue=Collapsed}"
                Value="{Binding ProgressValue, Mode=OneWay, FallbackValue=100}"
                Foreground="{Binding ProgressColor,FallbackValue=Red}"&gt;
          &lt;ProgressBar.Template&gt;
              &lt;ControlTemplate&gt;
                  &lt;Grid Name="TemplateRoot"
                        SnapsToDevicePixels="True"&gt;
                      &lt;Rectangle RadiusX="2"
                                 RadiusY="2"
                                 Fill="{TemplateBinding Panel.Background}" /&gt;
                      ...
  </code></pre>