public async Task <RealTimeStockItem> GetRealTimeStockAsync(StockInfoItem stockItem) { GoogleStockClient client = new GoogleStockClient(); RealTimeStockModel stockData = await client.QueryStockAsync(stockItem.Id); return(RealTimeStockItem.ConvertFrom(stockData)); }
public void AddStock(RealTimeStockItem item) { // check if the stock is exist in the list if (StockList.FirstOrDefault(x => x.Id == item.Id) == null) { StockList.Add(item); } }
public void AddStock(RealTimeStockItem item) { // check if the stock is exist in the list if (StockList.FirstOrDefault(x => x.Id == item.Id) == null) { StockList.Add(item); } }
public StockValueChartViewModel(IStockValueChartControlView view, IStockQueryService queryService, RealTimeStockItem realtimeStock) { _uiView = view; _queryService = queryService; ChartDataCollection = new ObservableCollection <DataPoint>(); StockValueContext = realtimeStock; }
/// <summary> /// Show the chart windows from stock /// </summary> public static void ShowStockChartDialog(IStockQueryService queryService, RealTimeStockItem stockItem) { StockMainChartPanel chartPanel = new StockMainChartPanel(); StockMainChartViewModel chartMainViewModel = new StockMainChartViewModel(chartPanel, queryService, stockItem); chartPanel.DataContext = chartMainViewModel; chartPanel.Show(); chartMainViewModel.Load(); }
public static List <RealTimeStockItem> Convert(this List <RealTimeStockModel> realTimeList) { List <RealTimeStockItem> resultList = new List <RealTimeStockItem>(); foreach (var model in realTimeList) { resultList.Add(RealTimeStockItem.ConvertFrom(model)); } return(resultList); }
public void RemoveStock(RealTimeStockItem item) { StockList.Remove(item); }
public void RemoveStock(RealTimeStockItem item) { StockList.Remove(item); }
public StockValueChartViewModel(IStockValueChartControlView view, IStockQueryService queryService, RealTimeStockItem realtimeStock) { _uiView = view; _queryService = queryService; ChartDataCollection = new ObservableCollection<DataPoint>(); StockValueContext = realtimeStock; }
public StockMainChartViewModel(IStockChartPanelView chartView, IStockQueryService queryService, RealTimeStockItem realtimeStock) { StockValueChart = new StockValueChartViewModel(chartView.StockValueChartView, queryService, realtimeStock); _realtimeStockModel = realtimeStock; }