Ejemplo n.º 1
0
 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();
 }
Ejemplo n.º 2
0
        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();
        }
Ejemplo n.º 3
0
        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();
        }
Ejemplo n.º 4
0
 public void DeleteDay(TrainingPlanDayViewModel dayViewModel)
 {
     Days.Remove(dayViewModel);
     Plan.RemoveDay(dayViewModel.Day);
     SetModifiedFlag();
 }