private void PopulateGlucoseDataPoints() { foreach (var glucose in Glucoses) { GlucoseDataPoints.Add(glucose.GetDataPoint()); } ; GlucoseDataPoints.Sort(point => point.X); }
public void AddGlucoseDatapoint(DataPoint point) { var item = GlucoseDataPoints.FirstOrDefault(p => p.X > point.X); if (item.Equals(new DataPoint())) { GlucoseDataPoints.Add(point); } else { var index = GlucoseDataPoints.IndexOf(item); GlucoseDataPoints.Insert(index, point); } }