void CircularGaugeControl_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { CircularGaugeControl gauge = sender as CircularGaugeControl; if(gauge != null) { CircularGaugeHitInfo hitInfo = gauge.CalcHitInfo(e.GetPosition(gauge)); if(hitInfo.InNeedle) selectedNeedle = hitInfo.Needle; } }
void CircularGaugeControl_MouseMove(object sender, MouseEventArgs e) { CircularGaugeControl gauge = (CircularGaugeControl)sender; ArcScaleNeedle currentSelectedNeedle = selectedNeedle != null ? selectedNeedle : gauge.CalcHitInfo(e.GetPosition(gauge)).Needle; if (currentSelectedNeedle != null) { ShowTooltip(currentSelectedNeedle, this, e.GetPosition(this)); } else { HideTooltip(); } }