I have the following XAML
<ProgressBar Grid.Column="0" Grid.Row="0" Margin="0,1" Minimum="0" Maximum="100" Value="{Binding Progress}">
<ProgressBar.Resources>
<Style TargetType="{x:Type ProgressBar}">
<Style.Triggers>
<DataTrigger Binding="{Binding DidAllServicesRestart}" Value="False">
<Setter Property="Foreground" Value="DarkRed"/>
<Setter Property="Value" Value="100"/>
</DataTrigger>
</Style.Triggers>
</Style>
</ProgressBar.Resources>
</ProgressBar>
The DataTrigger works great for setting Foreground to DarkRed, but setting the value of the progressbar to 100 does not work. I’m guessing because the {Binding Progress} overrides it?
How can I work around this?
You’re right that the
{Binding Progress}overrides it. In the Dependency Property order of precedence, the local value has the 3rd highest priority, whereas the style triggers are 6th.