locked
Progressbar not updating upon Maximum binding change RRS feed

  • Question

  •                         <ProgressBar Foreground="Red"
                                         Background="Transparent"
                                         Value="{Binding NumFailed, Mode=OneWay}"                                            
                                         Minimum="0"
                                         Maximum="{Binding NumTubes, Mode=OneWay, Converter={x:Static wpftools:DebuggingConverter.Instance}, ConverterParameter=Failedprogressbar}"
                                         FlowDirection="RightToLeft"
                                         Style="{DynamicResource {x:Static wpftools:CustomResources.StyleProgressBarVistaKey}}" />

    This is what my progressbar looks like at the moment.  The style came from http://mattserbinski.com/blog/look-and-feel-progressbar and the DebuggingConverter is a no-op converter that prints the value, type and parameter to the Console.  I have verified that the converter for the Maximum is being called when my NumTubes property is changed.

    Basically, the ProgressBar won't redraw until the Value changes.  So, if I have 2 tubes and 1 is failed, even if I add 20 more tubes, the bar is still half filled until the NumFailed changes, then the proportion is updated.  I've tried adding spurious notifications of the NumFailed property, but that apparently doesn't work since the value didn't change.

    Ideas?
    Tuesday, March 17, 2009 4:33 PM

Answers

  • stackoverflow had a faster response, sorry.  I even gave msdn a 4 hour headstart.

    http://stackoverflow.com/questions/655780/progressbar-not-updating-on-change-to-maximum-through-binding/656187#656187
    • Marked as answer by matelich Wednesday, March 18, 2009 3:43 PM
    Wednesday, March 18, 2009 3:43 PM