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