private static void EnsureDayButtonStyle(CalendarDayButton dayButton, Style oldDayButtonStyle, Style newDayButtonStyle)
{
Debug.Assert(dayButton != null, "The dayButton should not be null!");
if (newDayButtonStyle != null)
{
// REMOVE_RTM: Remove null check when Silverlight allows us to re-apply styles
// Apply the newDayButtonStyle if the DayButton was using the
// oldDayButtonStyle before
if (dayButton != null && (dayButton.Style == null || dayButton.Style == oldDayButtonStyle))
{
dayButton.Style = newDayButtonStyle;
}
}
}
#endregion CalendarDayButtonStyle