Hello
I´m creating a XAML template for the WPF ProgressBar. The following XAML code works fine if IsIndeterminate is set to False:
<ControlTemplate x:Key="DefaultProgressBarTemplate" TargetType="{x:Type ProgressBar}">
<ControlTemplate.Resources>
<SolidColorBrush x:Key="SolidBorderBrush" Color="#767676" />
<LinearGradientBrush x:Key="IndicatorBrush" StartPoint="0,0" EndPoint="1,0">
<LinearGradientBrush.GradientStops>
<GradientStop Color="#BCCF64" Offset="0.5" />
<GradientStop Color="#E1FF77" Offset="0.0" />
</LinearGradientBrush.GradientStops>
</LinearGradientBrush>
</ControlTemplate.Resources>
<Grid MinHeight="14">
<Border Name="PART_Track" CornerRadius="9" Background="Transparent" BorderBrush="{StaticResource SolidBorderBrush}" BorderThickness="1" SnapsToDevicePixels="True" />
<Border Name="PART_Indicator" CornerRadius="9" Background="{StaticResource IndicatorBrush}" BorderBrush="{StaticResource SolidBorderBrush}" BorderThickness="1" HorizontalAlignment="Left" SnapsToDevicePixels="True" />
</Grid>
</ControlTemplate>
<Style x:Key="{x:Type ProgressBar}" TargetType="{x:Type ProgressBar}">
<Setter Property="OverridesDefaultStyle" Value="True" />
<Setter Property="Template" Value="{StaticResource DefaultProgressBarTemplate}" />
</Style>
The indicator border fills up the ProgressBar from min to max. But if I set IsIndeterminate to True the indicator border fills up the entire ProgressBar (like it is set to max) and nothing is animated at all. Nothing I tried did change this behaviour of the ProgressBar. What do I have to do to have an IsIndeterminate animation similar to the one in the standard WPF ProgressBar ?
Thanks in advance
banzai