public TrainingPlanEntryViewModel(TrainingPlanDayViewModel parentDay, TrainingPlanEntry entry)
 {
     this.parentDay = parentDay;
     this.entry     = entry;
     Sets           = new ObservableCollection <TrainingPlanSetViewModel>();
     Image          = "pack://application:,,,/BodyArchitect.Client.Module.StrengthTraining;component/Images/TrainingPlanEntry.png";
     foreach (var set in entry.Sets)
     {
         Sets.Add(new TrainingPlanSetViewModel(this, set));
     }
     Update();
 }
        public void AddEntry(TrainingPlanDayViewModel day)
        {
            TrainingPlanEntry entry = new TrainingPlanEntry();
            var viewModel           = new TrainingPlanEntryViewModel(day, entry);

            viewModel.Header = StrengthTrainingEntryStrings.SelectExercise;
            day.Entries.Add(viewModel);
            day.Day.AddEntry(entry);
            day.IsExpanded       = true;
            viewModel.IsSelected = true;
            SetModifiedFlag();
        }
        public void AddDays(string name)
        {
            var day = new TrainingPlanDay();

            day.Name = name;
            var viewModel = new TrainingPlanDayViewModel(this, day);

            Days.Add(viewModel);
            plan.AddDay(day);
            viewModel.IsSelected = true;
            SetModifiedFlag();
        }
 public void DeleteDay(TrainingPlanDayViewModel dayViewModel)
 {
     Days.Remove(dayViewModel);
     Plan.RemoveDay(dayViewModel.Day);
     SetModifiedFlag();
 }