I\'ve a progressbar whose text changes dynamically. I want to update the appearance of it such that as soon as progress comes over text then text color should update. Someth
Here is one way to do it using a modified version of the ProgressBars default Template. It contains two TextBlocks
TextBlock is the black oneTextBlock is the white one. This TextBlock has the Width of the full control and Clip set to the Width of the progress part
The text of the ProgressBar is binding to the Tag property. Usable like this.
MyProgressBarStyle
RectConverter
public class RectConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
double width = (double)values[0];
double height = (double)values[1];
return new Rect(0, 0, width, height);
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}