/// <summary> /// Формирование массива данных для дня day /// </summary> /// <param name="data"></param> /// <param name="day"></param> private void Instance_DayRefreshed(DateTime day, List <CarStateModel> data) { var curentdata = data ?? new List <CarStateModel>(); var dt = new DateTime(day.Year, day.Month, day.Day); var first = curentdata.FirstOrDefault(); if (first == null || !first.DevID.Equals(CarSelector.SelectedCar.Car.Id) || !Vaiting || dt < DateStart || dt > DateStop) { return; } var el = HistoryRows.FirstOrDefault(o => o.Date.Equals(dt)); if (el == null) { DispatherThreadRun(() => { var item = new HistoryCarStateViewModel(curentdata, dt, _dispatcher); OnAddHistoryRow(item); HistoryRows.Add(item); }); } else { el.SortDataByDate(curentdata, dt); } //if(!_loadedObdData.Any(o => o.DT.ToDate.Equals(day))) }
protected virtual void OnAddHistoryRow(HistoryCarStateViewModel item) { if (AddHistoryRow != null) { AddHistoryRow(item); } }