public Dictionary <int, WatchlistTabModel> GetAllTabsData() { List <WatchlistTabModel> output = _sql.LoadData <WatchlistTabModel, dynamic>("dbo.spWatchlist_GetAllTabsData", new { }, "RAMData"); for (int i = 0; i < output.Count; i++) { List <string> symbols = _sql.LoadData <string, dynamic>("dbo.spWatchlist_GetTabSymbols", new { index = i + 1 }, "RAMData"); WatchlistTabModel tabModel = output[i]; tabModel.Symbols = symbols; } return(output.ToDictionary(x => x.TabIndex)); }
public WatchlistTabViewModel(IWatchlistCache watchlistCache, int index, IMarketDataHelper dataHelper) { _watchlistCache = watchlistCache; _tabIndex = index; _dataHelper = dataHelper; WatchlistTabModel tabData = _watchlistCache.TabWiseData[_tabIndex]; Header = tabData.TabName; var dataList = tabData.Symbols.Select(x => new LiveFeedDataModel { Symbol = x }); LiveFeedData = new ObservableCollection <LiveFeedDataModel>(dataList); _marketDataRows = CollectionViewSource.GetDefaultView(LiveFeedData); //_marketDataRows.CurrentChanged += _marketDataRows_CurrentChanged; _marketDataRows.Filter = _marketDataRows_Filter; Index1 = new WatchlistIndexModel { Symbol = tabData.Index1, Name = tabData.Index1 }; Index2 = new WatchlistIndexModel { Symbol = tabData.Index2, Name = tabData.Index2 }; Index3 = new WatchlistIndexModel { Symbol = tabData.Index3, Name = tabData.Index3 }; Index4 = new WatchlistIndexModel { Symbol = tabData.Index4, Name = tabData.Index4 }; Index5 = new WatchlistIndexModel { Symbol = tabData.Index5, Name = tabData.Index5 }; Index6 = new WatchlistIndexModel { Symbol = tabData.Index6, Name = tabData.Index6 }; }