On the ViewXY there is a BeforeZooming event, but it doesn't get raised when the user does a wheel zooming on the axis itself. On the axis there is a RangeChanged event but it does not allow to cancel the zoom and there is no way to retrieve the old zoom values as it only exposes the NewMax and NewMin (which are the same as axis.Minimum/Maximum).
Code: Select all
private void axisX_RangeChanged(object sender, RangeChangedEventArgs e)
{
Debug.WriteLine(String.Format("axisX_RangeChanged - NewMin: {0} - NewMax: {1} - CurrentMin: {2} - CurrentMax: {3}", e.NewMin, e.NewMax, e.Axis.Minimum, e.Axis.Maximum));
}
axisX_RangeChanged - NewMin: 32311.2172471072 - NewMax: 32371.2172471072 - CurrentMin: 32311.2172471072 - CurrentMax: 32371.2172471072
As my data samples come in at about 25ms, I dont need to zoom in more than 200ms and I would like to limit the zooming to that.
Do I need to recalculate and reassign Minimum and Maximum from within RangeChanged?
Thanks