/// <summary> /// Initializes a new instance of the <see cref="MonthSummaryViewModel"/> class. /// </summary> /// <param name="model">The first measurement for this month.</param> public MonthSummaryViewModel(Measurement measurement) { this.model = new MonthSummary(); this.model.Month = new DateTime(measurement.DateTime.Year, measurement.DateTime.Month, 1); this.model.TotalMeasures = 1; this.model.TotalGlucose = measurement.GlucoseValue; this.model.TotalInsuline = measurement.InsulineUnits; }
public MeasurementViewModel() { this.model = new Measurement(); this.model.DateTime = DateTime.Now; }
public MeasurementViewModel(Measurement model) { this.model = model; }
/// <summary> /// Removes the measurement. /// </summary> /// <param name="measurement">The measurement.</param> public void RemoveMeasurement(Measurement measurement) { this.Measurements.Remove(measurement); }
/// <summary> /// Adds the measurement. /// </summary> /// <param name="measurement">The measurement.</param> public void AddMeasurement(Measurement measurement) { this.Measurements.Add(measurement); this.Measurements.OrderBy(m => m.DateTime); }
/// <summary> /// Adds the measurement to the monthly summary and notify property changed. /// </summary> /// <param name="measurement">The measurement.</param> public void AddMeasurement(Measurement measurement) { this.model.TotalMeasures++; this.model.TotalGlucose += measurement.GlucoseValue; this.model.TotalInsuline += measurement.InsulineUnits; NotifyPropertyChanged("Glucose"); NotifyPropertyChanged("Insuline"); }