Пример #1
0
        private async void UpdatePlot(int plotLine)
        {
            string date = DateTime.Today.AddDays(Dias).ToString("yyyyMMdd");

            if (plotLine == 1)
            {
                try
                {
                    var symbol = myViewModel.GetLineOnePickerValue();

                    var requestResponse = await MyRequest.SendRequest(date, symbol);

                    LineSeriesOne.Points.Clear();
                    myViewModel.EmptyPlot(LineSeriesOne);

                    AddSeries(LineSeriesOne, requestResponse.ToString());
                } catch (System.NullReferenceException)
                {
                    return;
                }
            }

            if (plotLine == 2)
            {
                try {
                    var symbol = myViewModel.GetLineTwoPickerValue();

                    var requestResponse = await MyRequest.SendRequest(date, symbol);

                    LineSeriesTwo.Points.Clear();
                    myViewModel.EmptyPlot(LineSeriesTwo);

                    AddSeries(LineSeriesTwo, requestResponse.ToString());
                } catch (System.NullReferenceException)
                {
                    return;
                }
            }
            else
            {
                return;
            }
        }