Beispiel #1
0
        public ExercisesViewModel(bool hasResult, string search)
        {
            Search = search;

            if (!hasResult)
            {
                Exercises      = getAllExercises();
                ExerciseImages = getAllExercisesImages();
            }
            Categories = getAllCategories();
            AddData    = new AddToWorkoutData();
        }
Beispiel #2
0
        public ExercisesViewModel(bool hasResult)
        {
            if (!hasResult)
            {
                Exercises = getAllExercises();

                //Exercises.results = Exercises.results.OrderBy(x => x.category).ToList();

                ExerciseImages = getAllExercisesImages();

                foreach (ExerciseImage im in ExerciseImages.results)
                {
                    Exercise ex = Exercises.results.Find(x => x.id == im.id);
                    if (ex != null)
                    {
                        ex.imageURL = im.image;
                    }
                }
            }
            Categories = getAllCategories();
            AddData    = new AddToWorkoutData();
        }