Ios 触摸oxyplot线条系列don';行不通
我在ios项目中使用oxyplot绘制一些图表。我需要处理图形上的触摸,以便在其上添加注释。我正在使用触摸事件,但它不起作用。事实上,它有时有效,有时无效。它一开始是有效的,现在不再有效了。有人知道这个bug是什么吗 这是密码Ios 触摸oxyplot线条系列don';行不通,ios,xamarin,oxyplot,lineseries,Ios,Xamarin,Oxyplot,Lineseries,我在ios项目中使用oxyplot绘制一些图表。我需要处理图形上的触摸,以便在其上添加注释。我正在使用触摸事件,但它不起作用。事实上,它有时有效,有时无效。它一开始是有效的,现在不再有效了。有人知道这个bug是什么吗 这是密码 myLineChart.series1.TouchStarted += (sender, e) => { myLineChart.xCoordinate = e.Position.X; myLineCh
myLineChart.series1.TouchStarted += (sender, e) =>
{
myLineChart.xCoordinate = e.Position.X;
myLineChart.yCoordinate = e.Position.Y;
if(myLineChart.series1.Points != null){
timer = new System.Timers.Timer ();
timer.Interval = 400;
timer.Elapsed += (senderr, er) => {
InvokeOnMainThread ( () => {
dialog = new DialogView(View,Language.AddNoteLabel,Language.NotesQuestionLabel,Language.YesButton,Language.NoButton);
dialog.Show();
dialog.firstButton.TouchUpInside += (sender1, e1) => CreateNote ();
dialog.secondButton.TouchUpInside += (sender1, e1) => dialog.Dispose ();
});
timer.Dispose();
};
timer.Enabled = true;
}
e.Handled = true;
};
您可以考虑处理<强>氧绘图。模型。触摸完成< /强>事件。< /P>
private void HookEvents()
{
this.UnhookEvents();
if (this.plot != null && this.plot.Model != null)
{
this.plot.Model.TouchCompleted += this.PlotModelTouchCompletedHandler;
}
}
private void UnhookEvents()
{
if (this.plot != null && this.plot.Model != null)
{
this.plot.Model.TouchCompleted -= this.PlotModelTouchCompletedHandler;
}
}
private void PlotModelTouchCompletedHandler (object sender, OxyTouchEventArgs e)
{
// Put your logic to add custom node here.
}