private void daynew_Selected(object sender, DaySelectArgs e) { GeneralDay.Selected -= daynew_Selected; Day day = e.day; if (lastDay != null) { if (lastDay != day) { for (int i = 0; i < Days.Count; i++) { if (lastDay.SelectedDate.Month == Days[i].SelectedDate.Month) { if (lastDay.SelectedDate.Day == Days[i].SelectedDate.Day) { lastDay = Days[i]; Days.RemoveAt(i); Days.Insert(i, lastDay); } } } } } lastDay = day; OnDaySelected(day); }
private void daynew_Selected(object sender, DaySelectArgs e) { GeneralDay.Selected -= daynew_Selected; Day day = e.day; if (lastDay != null) { if (lastDay != day) { for (int i = 0; i < Days.Count; i++) { if (lastDay.SelectedDate.Month == Days[i].SelectedDate.Month) if (lastDay.SelectedDate.Day == Days[i].SelectedDate.Day) { lastDay = Days[i]; Days.RemoveAt(i); Days.Insert(i, lastDay); } } } } lastDay = day; OnDaySelected(day); }