コード例 #1
0
 private void PriceChangedEventHandler(Model[] quotes)
 {
     DatagridSource.Clear();
     for (int i = 0; i < quotes.Length; i++)
     {
         DatagridSource.Add(new RowViewModel(quotes[i]));
         //Chart.Add(new DataPoint(quotes[i].LastTradePrice, i*10));
         OnPropertyChanged("Chart");
     }
 }
コード例 #2
0
        private void PriceChangedEventHandler(Model[] quotes)
        {
            if (DatagridSource.Count == 0)
            {
                for (int i = 0; i < quotes.Length; i++)
                {
                    DatagridSource.Add(new RowViewModel(quotes[i]));
                }
            }
            else
            {
                for (int i = 0; i < quotes.Length; i++)
                {
                    DatagridSource[i].DayHighPrice = quotes[i].DayHighPrice;
                    DatagridSource[i].DayLowPrice = quotes[i].DayLowPrice;
                    DatagridSource[i].LastTradeDate = quotes[i].LastTradeDate;
                    DatagridSource[i].LastTradePrice = quotes[i].LastTradePrice;
                    DatagridSource[i].Name = quotes[i].Name;
                    DatagridSource[i].OpenPrice = quotes[i].OpenPrice;
                    DatagridSource[i].Symbol = quotes[i].Symbol;
                }

            }

            for (int i = 0; i < _lineSeries.Count; i++)
            {
                _lineSeries[i].Title = quotes[i].Symbol;
                _lineSeries[i].Points.Add(new DataPoint(DateTimeAxis.ToDouble(quotes[i].TradeTime), quotes[i].LastTradePrice));
            }

            //Chart.Add(new DataPoint(Refresh, quotes[0].LastTradePrice));
            //Chart1.Add(new DataPoint(Refresh, quotes[1].LastTradePrice));
            //Chart2.Add(new DataPoint(Refresh, quotes[2].LastTradePrice));
            Refresh++;
        }