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

SelectedDateMax() private static method

Inherited code: Requires comment.
private static SelectedDateMax ( Calendar cal ) : DateTime?
cal Calendar Inherited code: Requires comment 1.
return DateTime?
        private static DateTime? SelectedDateMax(Calendar cal)
        {
            DateTime selectedDateMax;

            if (cal.SelectedDates.Count > 0)
            {
                selectedDateMax = cal.SelectedDates[0];
                Debug.Assert(DateTime.Compare(cal.SelectedDate.Value, selectedDateMax) == 0, "The SelectedDate should be the maximum SelectedDate!");
            }
            else
            {
                return null;
            }

            foreach (DateTime selectedDate in cal.SelectedDates)
            {
                if (DateTime.Compare(selectedDate, selectedDateMax) > 0)
                {
                    selectedDateMax = selectedDate;
                }
            }
            return selectedDateMax;
        }
        #endregion DisplayDateEnd