private void UpdateMonth(int p) { MonthChangedEventArgs args = new MonthChangedEventArgs(); args.OldDisplayStartDate = DisplayStartDate; DisplayStartDate = DisplayStartDate.AddMonths(p); args.NewDisplayStartDate = DisplayStartDate; args.RoutedEvent = DisplayMonthChangedEvent; RaiseEvent(args); }
/// <summary> /// 更新月 /// </summary> /// <param name="monthsToAdd">添加的月数</param> private void UpdateMonth(int monthsToAdd) { var ev = new MonthChangedEventArgs { OldDisplayStartDate = _displayStartDate }; DisplayStartDate = DisplayStartDate.AddMonths(monthsToAdd); ev.NewDisplayStartDate = DisplayStartDate; if (DisplayMonthChanged != null) { DisplayMonthChanged(ev); } BuildCalendarUI(); }