LockableCollection <TradingDataViewModel> CreateVolumeDynamicsBindingData(StockData[] data) { LockableCollection <TradingDataViewModel> result = new LockableCollection <TradingDataViewModel>(); foreach (StockData currentData in data) { CompanyTradingData ctd = new CompanyTradingData(currentData, ""); ctd.Close = double.Parse(currentData.CloseP.ToString()); ctd.Volume = Math.Round(((double)ctd.Volume / 1000000), 2); ctd.Low = double.Parse(currentData.LowP.ToString()); ctd.High = double.Parse(currentData.HighP.ToString()); result.Add(new TradingDataViewModel(ctd)); } return(result); }
public RealTimeDataViewModel(Timer timer) { TimerCore = timer; TimerCore.Interval = offlineTimeInterval; TimerCore.Tick += new EventHandler(UpdateOnTimer); model = new RealTimeDataModel(); model.UpdateFailed += new EventHandler <RealTimeDataEventArgs>(OnUpdateFailed); model.Initialized += new EventHandler <EventArgs>(OnInitialized); stockChartBindingData = new BindingList <TradingDataViewModel>(); watchLisBindingData = new LockableCollection <CompanyTradingDataViewModel>(); transactionGridBindingData = new LockableCollection <TransactionData>(); volumeChartBindingData = new BindingList <CompaniesVolumeData>(); IsLoading = true; }