LogarithmicAxis does not raise AxisChanged Event when zooming

Aug 13, 2013 at 6:38 PM
Edited Aug 13, 2013 at 6:44 PM
Obviously a bug; the overridden ZoomAt-Method in LogarithmicAxis.cs does not raise the Event.

I think you would need to add a RaiseAxisChanged-Method in the base Axis Class to allow the child class to raise the event?
Aug 13, 2013 at 7:05 PM
Edited Aug 13, 2013 at 7:06 PM
My way of fixing it - and also dealing with another bug, which causes the AxisChanged-Event to fire before the limits are actually updated:
    Public Class LogAxis
        Inherits Axes.LogarithmicAxis

        Public Event ActualAxisChanged(min As Double, max As Double)

        Public Overrides Sub ZoomAt(factor As Double, x As Double)
            MyBase.ZoomAt(factor, x)
            RaiseEvent ActualAxisChanged(ViewMinimum, ViewMaximum)
        End Sub

        Private Sub Axis_Changed() Handles MyBase.AxisChanged
            RaiseEvent ActualAxisChanged(ViewMinimum, ViewMaximum)
        End Sub
    End Class
Coordinator
Aug 14, 2013 at 5:02 AM
Thank you! I have fixed the bug and added an example to verify that it works.
Coordinator
Aug 14, 2013 at 5:04 AM
Note that the UpdateActualMaxMin(); method is called - you should use ActualMaximum and ActualMinimum to get the actual limits.
Aug 14, 2013 at 6:16 AM
Wow, that was fast, thanks a lot!