You can use GradiantBrush and install GradientStops based on your logic, the only drawback of this solution is that GradientStops are not bindable, so you have to install them from the code. Here is a simple taste:
<ProgressBar Width="500" Value="70" Height="30"> <ProgressBar.Foreground> <LinearGradientBrush StartPoint="0,0" EndPoint="1,0" > <GradientStop Color="Green" Offset="0" /> <GradientStop Color="Green" Offset="0.3" /> <GradientStop Color="Red" Offset="0.3" /> <GradientStop Color="Red" Offset="0.5" /> <GradientStop Color="Green" Offset="0.5" /> <GradientStop Color="Green" Offset="1" /> </LinearGradientBrush> </ProgressBar.Foreground> </ProgressBar>
Output:

Usama source share