/// <summary> /// Invoked whenever application code or an internal process, /// such as a rebuilding layout pass, calls the ApplyTemplate method. /// </summary> public override void OnApplyTemplate() { if (_monthControl != null) { _monthControl.Owner = null; } base.OnApplyTemplate(); _monthControl = GetTemplateChild(ElementMonth) as CalendarItem; if (_monthControl != null) { _monthControl.Owner = this; } this.CurrentDate = this.DisplayDate; UpdateCellItems(); }
private static void EnsureMonthStyle(CalendarItem month, Style oldMonthStyle, Style newMonthStyle) { Debug.Assert(month != null); if (newMonthStyle != null) { // if (month != null && (month.Style == null || month.Style == oldMonthStyle)) { month.Style = newMonthStyle; } } }
internal InternalTestHook(CalendarItem mon) { _month = mon; }
/// <summary> /// Inherited code: Requires comment. /// </summary> /// <param name="month">Inherited code: Requires comment 1 .</param> /// <param name="oldMonthStyle">Inherited code: Requires comment 2 .</param> /// <param name="newMonthStyle">Inherited code: Requires comment 3.</param> private static void EnsureMonthStyle(CalendarItem month, Style oldMonthStyle, Style newMonthStyle) { Debug.Assert(month != null, "month should not be null!"); if (newMonthStyle != null) { // REMOVE_RTM: Remove null check when Silverlight allows us to re-apply styles // Apply the newMonthStyle if the Month was using the // oldMonthStyle before if (month != null && (month.Style == null || month.Style == oldMonthStyle)) { month.Style = newMonthStyle; } } }