Oxyplot模型手柄按键

时间:2015-05-07 17:53:40

标签: c# wpf oxyplot

OxyPlot的PlotModel和PlotController组件包含自己的鼠标处理程序,您可以添加或删除自己的处理程序。对于实例:

this.Model.MouseMove += this.ModelOnMouseMove;

public void ModelOnMouseMove(object sender, OxyMouseDownEventArgs e)
{
    // Do some mouse stuff...
}

模型是否有办法以类似方式捕获KeyBoard Key印刷机?

1 个答案:

答案 0 :(得分:1)

OxyPlot显然有一个Model.Keydown Even Handler,它在PlotModel聚焦时触发。它似乎没有太多的文档:

this.Model.KeyDown += ModelOnKeyDown;

private void ModelOnKeyDown(object sender, OxyKeyEventArgs e)
{
     if (e.Key == OxyKey.Up)
     {
        // Do Some Stuff
     }
     else if (e.Key == OxyKey.Down)
     {
         // Do Some Stuff
     }
 }