public void OnSaveClicked(object sender, EventArgs eventArgs) { SelectedComplex.Name = txtName.Text; SelectedComplex.DurationTimePerExerciseInSeconds = EnumHelper.Parse <DurationEnum>(picDuration.SelectedItem.ToString()); ComplexService.Save(SelectedComplex); }
public async void OnSaveClicked(object sender, EventArgs e) { var list = (listExercises.ItemsSource as IEnumerable <SelectedExerciseViewModel>).ToList(); list = list.Where(x => x.IsSelected).ToList(); SelectedComplex.Exercise = ExerciseService.GetList().Where(x => list.Select(y => y.Id).Contains(x.Id)).ToList(); ComplexService.Save(SelectedComplex); await Navigation.PopAsync(); }