private void PopulateInsulinDataPoints() { foreach (var insulin in Insulins) { InsulinDataPoints.Add(insulin.GetDataPoint()); } InsulinDataPoints.Sort(point => point.X); }
public void AddInsulinDatapoint(DataPoint point) { var item = InsulinDataPoints.FirstOrDefault(p => p.X > point.X); if (item.Equals(new DataPoint())) { InsulinDataPoints.Add(point); } else { var index = InsulinDataPoints.IndexOf(item); InsulinDataPoints.Insert(index, point); } }