public void Add() { TrainingSets.Add(new TrainingItem(true)); SelectedTItem = TrainingSets.LastOrDefault(); foreach (var item in TrainingSets) { NotifyOfPropertyChange(() => item); } OnDataChange(); }
public void Remove(TrainingItem trainingItem) { bool isSelected = SelectedTItem == trainingItem; TrainingSets.Remove(trainingItem); if (isSelected) { SelectedTItem = TrainingSets.LastOrDefault(); } OnDataChange(); }
public void AddRange(IList <TrainingItem> items) { Clear(); foreach (var item in items) { TrainingSets.Add(item.SubcribeTrainingSet()); } SelectedTItem = TrainingSets.LastOrDefault(); isChange = false; OnDataChange(); }