public void SelectCell(ScheduleCell cell) { this.UnselectCells(); if (this.cells.Contains(cell)) { cell.IsSelected = true; } }
void SelectedCellChanged(ScheduleCell cell) { this.currentCell = cell; if (cell.IsDoubledLesson) { this.cbLesson.SelectedIndex = -1; this.chbIsDoubled.IsChecked = true; this.cbLesson.SelectedIndex = 0; } else { this.chbIsDoubled.IsChecked = false; this.cbLesson.SelectedIndex = -1; this.SetLessonInfo(this.CurrentLesson); } }
void MakeTable() { this.Children.Clear(); this.RowDefinitions.Clear(); this.ColumnDefinitions.Clear(); this.cells.Clear(); this.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(5) }); this.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) }); this.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(5) }); this.RowDefinitions.Add(new RowDefinition { Height = new GridLength(5) }); //this.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto }); this.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1,GridUnitType.Star) }); for (int i = 0; i < this.RowCount; ++i) { this.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) }); ScheduleCell cell = new ScheduleCell {Index = i + 1}; this.cells.Add(cell); ScheduleDay.SetRow(cell, i + 2); ScheduleDay.SetColumn(cell, 1); this.Children.Add(cell); } this.RowDefinitions.Add(new RowDefinition { Height = new GridLength(5) }); ScheduleDay.SetRow(this.header, 1); ScheduleDay.SetColumn(this.header, 1); this.Children.Add(this.header); this.Children.Add(this.border); ScheduleDay.SetZIndex(this.border, -1); ScheduleDay.SetRow(this.border, 0); ScheduleDay.SetRowSpan(this.border, this.RowDefinitions.Count); ScheduleDay.SetColumn(this.border, 0); ScheduleDay.SetColumnSpan(this.border, this.ColumnDefinitions.Count); }