C# 如何将鼠标键绑定到鼠标悬停轨迹?

C# 如何将鼠标键绑定到鼠标悬停轨迹?,c#,controller,oxyplot,C#,Controller,Oxyplot,我基本上想要切换鼠标右键和左键。我想用左键平移,用右键查看序列值。将左键绑定到平移效果很好,但当我尝试绑定鼠标右键查看数据时,会出现问题-如果单击一次,数据不会消失,除非光标离开PlotView。它的行为就像我拿着它,而实际上我没有。我在下面提供了一些基本代码: var plotViewMain = new PlotView(); var controller = new PlotController(); controller.UnbindAll(); controller.BindMous

我基本上想要切换鼠标右键和左键。我想用左键平移,用右键查看序列值。将左键绑定到平移效果很好,但当我尝试绑定鼠标右键查看数据时,会出现问题-如果单击一次,数据不会消失,除非光标离开PlotView。它的行为就像我拿着它,而实际上我没有。我在下面提供了一些基本代码:

var plotViewMain = new PlotView();
var controller = new PlotController();

controller.UnbindAll();
controller.BindMouseDown(OxyMouseButton.Left, OxyPlot.PlotCommands.PanAt);
controller.BindMouseDown(OxyMouseButton.Right, OxyPlot.PlotCommands.HoverTrack);
plotViewMain.Controller = controller;

PlotCommands.HoverTrack
只要鼠标悬停在点或轨迹上,就会显示数据。如果希望仅在用户单击点或轨迹时显示数据点,则可能应使用PlotCommands.Track

controller.BindMouseDown(OxyMouseButton.Right, OxyPlot.PlotCommands.Track);