private void UpdateYear(int YearsToAdd) { MonthChangedEventArgs ev = new MonthChangedEventArgs(); ev.OldDisplayStartDate = _DisplayStartDate; this.DisplayStartDate = _DisplayStartDate.AddYears(YearsToAdd); ev.NewDisplayStartDate = _DisplayStartDate; DisplayMonthChanged?.Invoke(ev); BuildCalendarUI(); }
protected override void OnChangedCurrent(FrameworkElement oldEl, FrameworkElement newEl) { if (oldEl != null) { (oldEl as TCalendarGrid).SelectionChanged -= CalendarPicker_SelectionChanged; } if (newEl != null) { (newEl as TCalendarGrid).SelectionChanged += CalendarPicker_SelectionChanged; } DisplayMonthChanged?.Invoke(this, new EventArgs()); DisplayMonth = this.GetCurrentDisplayMonth(); }