private void Update() { if (this.Day.Taskgroups.Count < 1) { return; } foreach (Taskgroup taskgroup in Day.Taskgroups) { AppointmentControl appointmentControl = new AppointmentControl( this, taskgroup ); AppointmentContainer.Children.Add(appointmentControl); } }
private void OnAddButtonClicked(object sender, RoutedEventArgs e) { string title = "Neue Gruppe"; int i = 1; while (CalendarPage.Project.Taskgroups.Exists(x => x.Title == title)) { title = title.Split(' ')[0] + " " + title.Split(' ')[1] + " " + (++i); } Taskgroup taskgroup = new Taskgroup(title) { Deadline = this.Day.Date }; this.CalendarPage.Project.Taskgroups.Add(taskgroup); AppointmentControl appointmentControl = new AppointmentControl( this, taskgroup ); AppointmentContainer.Children.Add(appointmentControl); appointmentControl.TitleLabel.BeginEditing(); }