private void AddExcerciseToPlan(Excercise e) { try { Excercises.Add(e); } catch (Exception ex) { Application.Current.MainPage.DisplayAlert("Alert", ex.Message, "ok"); } }
public override void Init(object initData) { var data = initData as dynamic; TodaysPlan = data.plan; TodaysTraining.Date = data.date; foreach (var item in TodaysPlan.Excercises) { Excercises.Add(item); } TodaysTraining.Plan = TodaysPlan.PlanName; }
public void Add(Activity activity, DateTime start, DateTime end) { var act = Activities.SingleOrDefault(a => a.Name == activity.Name); if (act == null) { Activities.Add(activity); var excercise = new Excercise(start, end, activity, User); Excercises.Add(excercise); } else { var excercise = new Excercise(start, end, act, User); Excercises.Add(excercise); } Save(); }