public void UpdateView() { panelAgenda.Children.Clear(); foreach (Day day in DataManager.Schedule.Days) { List <Class> classes = day.GetClasses(); if (classes.Count == 0) { continue; } DayCard dayCard = new DayCard(day); if (!(dayCard.FindName("ClassesView") is StackPanel dayCardPanel)) { continue; } panelAgenda.Children.Add(dayCard); foreach (Class _class in classes) { ClassCard card = new ClassCard(_class, day); dayCardPanel.Children.Add(card); } } }
private void InitDayLine() { DayLine = new ObservableCollection <UIElement>(); foreach (var day in _timeLineMarkup.Days) { var dvm = new DayCardViewModel(day.Item); var dc = new DayCard { DataContext = dvm }; Grid.SetRow(dc, TitleRowsCount + day.Row); Grid.SetColumn(dc, day.Column); Grid.SetRowSpan(dc, day.RowSpan); Grid.SetColumnSpan(dc, day.ColumnSpan); DayLine.Add(dc); } }