private void startListening() { if (HRData.Count > 0) { HRData.Clear(); HRData = new ObservableCollection <HRData>(); } CanStartExecute = false; CanStopExecute = true; m_heartRateListener.Start(); m_timer.Start(); }
private void processHrData(HRData p_hrData) { ObservableCollection <HRData> hrDataList = new ObservableCollection <HRData>(); int index = 0; int firstCollectionIndex = 0; if (HRData.Count == m_uiConfig.NumOfVisibleItems) { firstCollectionIndex = 1; } for (int i = firstCollectionIndex; i < HRData.Count; i++) { hrDataList.Add(new HRData(HRData[i].Bpm, HRData[i].Time, index++)); } hrDataList.Add(new HRData(p_hrData.Bpm, p_hrData.Time, index)); HRData.Clear(); HRData = hrDataList; LastBpmValue = HRData.Last().Bpm; }