How do I specify the min and max values of the scale ?

Nov 5, 2010 at 3:57 PM

Thanks for writing/sharing this control.

There seems to be 2 properties called MinValue and MaxValue but they don't work as I'd expect them to.

Drop the following XAML into a WPF Window and watch the property values update. Changing Value causes MaxValue to change - as a result the scale keeps on changing. How do I turn off the "auto-scale" behavior ?


  • value = 5 causes maxValue = 10
  • value = 15 => maxValue = 50
  • value = 55 => maxValue = 100 (and so on to the next nearest multiple of 50

Explicitly Setting the maxValue property does not refresh the gauge scale.

StackPanel> <my:Gauge x:Name="g1" Height="200" Width="200"/> <StackPanel> <TextBlock>MinScale</TextBlock> <TextBox Text="{Binding ElementName=g1, Path=MinValue}"/> <TextBlock>MaxScale</TextBlock> <TextBox Text="{Binding ElementName=g1, Path=MaxValue}"/> <TextBlock>Value</TextBlock> <TextBox Text="{Binding ElementName=g1, Path=Value}"/> </StackPanel> </StackPanel>

What I am looking for is a simple guage:

  • Set the Min and Max Scale values (which should then remain fixed unless these values are modified explicitly)
  • Value property would change at runtime (causing the gauge to update - this works currently)
  • In case, the value exceeds the range, I'd like to update the MaxValue explicitly (causing the guage scale to refresh.)
Nov 5, 2010 at 8:06 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Nov 5, 2010 at 8:35 PM

Hi Gishu,

Thanks for catching this bug.  The MinValue & MaxValue were being ignored due to the absence of the AutoScale property.  I have fixed this issue and checked it in via change set 1015.

I have added the property AutoScale to the Gauge.  This property is set to true by default.  If the value of AutoScale is true, the MinValue & MaxValue properties will be ignored.  If the AutoScale property is set to true, the MinValue & MaxValue properties will be respected.

Sorry for any inconvenience or confusion.



Nov 8, 2010 at 6:59 AM

Double thumbs up for responsiveness on an open source project :D

I checked out the codebase with the fix and built it.. In the sample app, it now behaves like I wanted to. Thanks a lot, Terry!

I've got some more suggestions/requests - will file them as soon as I get some free time.