Пример #1
0
        public static Task <WorkoutViewModel> CreateAsync(Workout workout, IWorkoutStore workoutStore, IPageService pageService)
        {
            _workoutStore = workoutStore;
            _pageService  = pageService;
            var ret = new WorkoutViewModel(workout);

            return(ret.GetWorkoutObjects(workout));
        }
Пример #2
0
 public ModelExercisesViewModel(IWorkoutStore workoutStore, IPageService pageService)
 {
     _pageService              = pageService;
     _workoutStore             = workoutStore;
     RefreshDatabaseCommand    = new Command(async() => await RefreshDatabase());
     LoadDataCommand           = new Command(async() => await LoadData());
     ReloadDataCommand         = new Command(async() => await ReloadData());
     DropModelExercisesCommand = new Command(async() => await DropModelExercises());
     SelectExerciseCommand     = new Command <ModelExercise>(async(e) => await SelectExercise(e));
 }
Пример #3
0
 public WorkoutsOverviewViewModel(IWorkoutStore workoutStore, IPageService pageService)
 {
     _pageService         = pageService;
     _workoutStore        = workoutStore;
     LoadDataCommand      = new Command(async() => await LoadData());
     AddWorkoutCommand    = new Command(async() => await AddWorkout());
     EditWorkoutCommand   = new Command(async() => await EditWorkout());
     DeleteWorkoutCommand = new Command(async() => await DeleteWorkout());
     SelectWorkoutCommand = new Command <Workout>(w => SelectWorkout(w));
 }
Пример #4
0
        public static async Task <ModelExerciseViewModel> CreateAsync(ModelExercise exercise, IWorkoutStore workoutStore)
        {
            _workoutStore = workoutStore;

            ModelExerciseViewModel exerciseViewModel = new ModelExerciseViewModel(exercise);

            exerciseViewModel.PrimaryMuscles = await GetMuscles("Primary");

            exerciseViewModel.SecondaryMuscles = await GetMuscles("Secondary");

            return(exerciseViewModel);
        }
Пример #5
0
 public WorkoutController(IUserContext usercontext, IWorkoutStore workoutStore)
 {
     _userContext  = usercontext;
     _workoutStore = workoutStore;
 }