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

Calendar_GotFocus() private method

Inherited code: Requires comment.
private Calendar_GotFocus ( object sender, RoutedEventArgs e ) : void
sender object Inherited code: Requires comment 1.
e Windows.UI.Xaml.RoutedEventArgs Inherited code: Requires comment 2.
return void
        private void Calendar_GotFocus(object sender, RoutedEventArgs e)
        {
            Calendar c = sender as Calendar;
            Debug.Assert(c != null, "c should not be null!");
            HasFocusInternal = true;

            switch (DisplayMode)
            {
                case CalendarMode.Month:
                    {
                        DateTime focusDate;
                        if (LastSelectedDate.HasValue && DateTimeHelper.CompareYearMonth(DisplayDateInternal, LastSelectedDate.Value) == 0)
                        {
                            focusDate = LastSelectedDate.Value;
                        }
                        else
                        {
                            focusDate = DisplayDate;
                            LastSelectedDate = DisplayDate;
                        }
                        Debug.Assert(focusDate != null, "focusDate should not be null!");
                        FocusButton = FindDayButtonFromDay(focusDate);

                        if (FocusButton != null)
                        {
                            FocusButton.IsCurrent = true;
                        }
                        break;
                    }
                case CalendarMode.Year:
                case CalendarMode.Decade:
                    {
                        if (this.FocusCalendarButton != null)
                        {
                            FocusCalendarButton.IsCalendarButtonFocused = true;
                        }
                        break;
                    }
            }
        }