Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/meteor/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 触摸oxyplot线条系列don';行不通_Ios_Xamarin_Oxyplot_Lineseries - Fatal编程技术网

Ios 触摸oxyplot线条系列don';行不通

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

我在ios项目中使用oxyplot绘制一些图表。我需要处理图形上的触摸,以便在其上添加注释。我正在使用触摸事件,但它不起作用。事实上,它有时有效,有时无效。它一开始是有效的,现在不再有效了。有人知道这个bug是什么吗

这是密码

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.
}