public static void SetState(NPlot.Windows.PlotSurface2D graph, MouseState mouseState) { switch (mouseState) { case MouseState.Pan: graph.RemoveInteraction(zoomInteraction); graph.AddInteraction(panInteraction); break; case MouseState.Zoom: graph.RemoveInteraction(panInteraction); graph.AddInteraction(zoomInteraction); break; case MouseState.Pointer: graph.RemoveInteraction(zoomInteraction); graph.RemoveInteraction(panInteraction); break; } }