Hello, I have two questions concerning the barmarker in my gauge. I have a linear gauge that has a value range from -25 to 25. I'd like the bar marker to start out in the middle of the gauge at zero, and then either grow up or down based on the value. Is there a way to do this?
Also, is there a way to set the responsetime and refreshrate fields for a barmarker so that it will look animated instead of just jumping from value to value as the value changes? I'd like to behave like my needles do.
Hi Llaslo,
The bar markers do not have a Response property that would allow you to enable animations or set a refresh rate/response time. The XamLinearGuage bar markers don't support animations. I believe only the needle supports the animations.
If you wish to animate the bar marker then you will need to handle the animations yourself. I've attached a sample that animates the bar marker by binding the bar marker Value property to a DependencyProperty I added in code behind. I then use a DoubleAnimation to animate this dependency property to the target value. This ends up animating the bar marker for me.
Let me know if you have any questions on this.
Let me know if you have any further questions on this matter.
I dl'd the sample you gave me, and saw how it works. I'm actually working to get that plugged into my MVVM prism application. So far I haven't been able to get it to work exactly right, but i'm still playing with it.
I've attached an updated sample that uses MVVM and allows for growing/shrinking of the bar marker by animating the view model value. Let me know if you have any questions on this.
Hi,
I have a further question: What about the issue "let the barmarker start in the middle"?
I have the same problem: a scale that goes from a negative to a positve value. And I want to show the value with a barmarker that starts at the "0" in the middle of the LinearGauge. But it always starts from the bottom line (I've switched to vertical layout). Anything I can do?
Thanks
Michael
Hi Michael,
I'm a little late but if you have set the StartValue and EndValue for the LinearGaugeScale to start at your negative number and end on your positive number then your value range should already be setup. Depending on what the interval is that you have set for the labels though, "0" might not be seen in the middle. For example, if I set the StartValue to -25 and the EndValue to 25, setting the interval to 25 should place 0 in the center of the gauge. The labels used are governed by the StartValue and the Interval.