private void SaveButton_Clicked(object sender, EventArgs e) { var selected = GetSelectedItem(); if (selected.Count == 0) { Navigation.PopModalAsync(); return; } var newPlan = new Plan { DatePerformed = SelectedDate.Date, }; foreach (Train t in selected) { newPlan.AddTrain(t); } DB.conn.Insert(newPlan); Navigation.PopModalAsync(); }