public BaseDrillVIewModel(PageModes pageMode) : base(pageMode) { MuscleGroupsService muscleGroupsService = new MuscleGroupsService(); muscleGroupsService.GetAllMuscleGroups().ContinueWith(async task => { if (task.Result == null) { await App.Current.MainPage.DisplayAlert("Operation Failed", "Muscle groups where unable to load", "OK"); } else { PossibleMuscleGroups = task.Result; foreach (MuscleGroupDTO muscleGroup in Drill.MuscleGroups) { this.PossibleMuscleGroups.All(currPossibleMusclGroup => { if (currPossibleMusclGroup.Id == muscleGroup.Id) { currPossibleMusclGroup.ShouldInclude = true; } return(true); }); } OnPropertyChanged("PossibleMuscleGroups"); } }); }
public MuscleGroupsController(MuscleGroupsService mgs) { _mgs = mgs; }