private void kalendar_ItemDeleted(object sender, ItemEventArgs e) { MyTermin deletedTermin = (MyTermin)e.Item; Subject deletedTerminSubject = deletedTermin.ForSubject; TerminHandler.Instance.RemoveTermin(deletedTermin); SubjectHandler.Instance.ChangeUnscheduledTermins(deletedTerminSubject.Id, false); (Window.GetWindow(this) as MainWindow).GlobalnaShema.globalCalendar.Schedule.Items.Remove(deletedTermin); UpdateSubjectRow(deletedTerminSubject); SubjectsList.UnselectAll(); }
/// <summary> /// Mijenjamo boju i ToolTip reda u listi predmeta u skladu sa brojem NEraspoređenih termina. /// </summary> /// <param name="subject"></param> private void UpdateSubjectRow(Subject subject) { DataGridRow row = SubjectsList.ItemContainerGenerator.ContainerFromItem(subject) as DataGridRow; if (subject.UnscheduledTermins < 1) { row.Background = Brushes.PaleGreen; row.ToolTip = "Predmet " + subject.Name + " je raspoređen."; } else { row.Background = Brushes.PaleGoldenrod; // black'n gold baby :P row.ToolTip = "Predmet " + subject.Name + " ima neraspoređene termine."; } SubjectsList.UnselectAll(); }