WinRTXamlToolkit.Controls.Calendar.OnCalendarDayButtonStyleChanged C# (CSharp) Method

OnCalendarDayButtonStyleChanged() private static method

Inherited code: Requires comment.
private static OnCalendarDayButtonStyleChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void
d Windows.UI.Xaml.DependencyObject Inherited code: Requires comment 1.
e Windows.UI.Xaml.DependencyPropertyChangedEventArgs Inherited code: Requires comment 2.
return void
        private static void OnCalendarDayButtonStyleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            Style newStyle = e.NewValue as Style;
            Style oldStyle = e.OldValue as Style;
            Calendar c = d as Calendar;

            if (newStyle != null && c != null)
            {
                CalendarItem monthControl = c.MonthControl;

                if (monthControl != null && monthControl.MonthView != null)
                {
                    foreach (UIElement child in monthControl.MonthView.Children)
                    {
                        CalendarDayButton dayButton = child as CalendarDayButton;

                        if (dayButton != null)
                        {
                            EnsureDayButtonStyle(dayButton, oldStyle, newStyle);
                        }
                    }
                }
            }
        }