Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
560
Drawing Gauge Needle out of bounds
posted

Hello,

inside my UI I'm using the XamLinearGauge. There is a binding between the Needle Value and a DataObject.

In case the DataObjects value is higher or lower than the Gauge scale, the Needle will be drawn outside the XamLinearGauge. Is there a possibility to keep the needle inside the Gauge bounds. I tried to do this with the needles "value changed" event:

 public void Needle_ValueChanged(object sender, EventArgs e)
        {
          LinearGaugeScale  sc = this.Gauge.Scales[0];
          LinearGaugeNeedle nd = (LinearGaugeNeedle) sender;

          if (nd.Value > sc.EndValue)
          {
            nd.Value = sc.EndValue;
          }

          if (nd.Value < sc.StartValue)
          {
            nd.Value = sc.StartValue;
          }
        }

Unfortunately this isn't working as aspected. By the first value out of scale the needle sticks to the StartValue or the EndValue and won't change in the further proceeding of the program.

Any help would be appreciated.

Parents Reply Children
No Data