示例#1
0
 public void Add()
 {
     TrainingSets.Add(new TrainingItem(true));
     SelectedTItem = TrainingSets.LastOrDefault();
     foreach (var item in TrainingSets)
     {
         NotifyOfPropertyChange(() => item);
     }
     OnDataChange();
 }
示例#2
0
        public void Remove(TrainingItem trainingItem)
        {
            bool isSelected = SelectedTItem == trainingItem;

            TrainingSets.Remove(trainingItem);
            if (isSelected)
            {
                SelectedTItem = TrainingSets.LastOrDefault();
            }

            OnDataChange();
        }
示例#3
0
        public void AddRange(IList <TrainingItem> items)
        {
            Clear();
            foreach (var item in items)
            {
                TrainingSets.Add(item.SubcribeTrainingSet());
            }

            SelectedTItem = TrainingSets.LastOrDefault();
            isChange      = false;
            OnDataChange();
        }