private static void EnsureCalendarButtonStyle(CalendarButton calendarButton, Style oldCalendarButtonStyle, Style newCalendarButtonStyle)
{
Debug.Assert(calendarButton != null, "The calendarButton should not be null!");
if (newCalendarButtonStyle != null)
{
// REMOVE_RTM: Remove null check when Silverlight allows us to re-apply styles
// Apply the newCalendarButtonStyle if the CalendarButton was
// using the oldCalendarButtonStyle before
if (calendarButton != null && (calendarButton.Style == null || calendarButton.Style == oldCalendarButtonStyle))
{
calendarButton.Style = newCalendarButtonStyle;
}
}
}
#endregion CalendarButtonStyle