I was having trouble getting the solution here to work, but I found another work around. My progress bar wouldn't update as I changed the datasource of my object (11 of 11 would change to 10 of 10 and freeze the progress bar), and realized that I didn't need to update maximum value at all.
Instead I used a converter on the value to convert it to a percent, and set my maximum at 100. The result displays the same, but without the bug for changing maximum value.
public class CreatureStaminaConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var creature = (CreatureBase.CreatureEntityData) value;
double max = creature.entityData.MaxStat;
return creature.CurrentStamina/max*100;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return null;
}
}