コード例 #1
0
        public WorkoutExerciseAddViewModel()
        {
            WorkoutExerciseAdd  = new WorkoutExercise();
            WorkoutExerciseList = new ObservableCollection <WorkoutExercise>(new WorkoutExerciseRepository().GetAll());
            WorkoutList         = new WorkoutRepository().GetAll().OrderByDescending(o => o.ExpirationDate).ToList();
            ExerciseList        = new ExerciseRepository().GetAll().OrderBy(o => o.Name).ToList();
            WorkoutAdd          = WorkoutList.FirstOrDefault();
            ExerciseAdd         = ExerciseList.FirstOrDefault();

            SaveCommand   = new Command(SaveWorkoutExercise);
            LoadCommand   = new Command <WorkoutExercise>(LoadWorkoutExercise);
            DeleteCommand = new Command <WorkoutExercise>(DeleteWorkoutExercise);
        }