Posted 12 years ago
by Ilian Pinzon
Version: 13.1.0582
Platform: .NET 4.0
Environment: Windows 7 (64-bit)

Hi Guys,
As the title says, the DateTimeEditBox popup (i.e. MonthCalendar) crashes when Maximum is set to DateTime.MaxValue. This can be reproduced with:
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:ae="clr-namespace:ActiproSoftware.Windows.Controls.Editors;assembly=ActiproSoftware.Editors.Wpf">
<StackPanel>
<ae:DateTimeEditBox Maximum="{x:Static sys:DateTime.MaxValue}" Value="9999-10-31" />
</StackPanel>
</Page>
Steps to reproduce:
- Open the edit box's drop down. Still OK here.
- Press the right arrow to move the month to November 9999. Still OK here.
- Press the right arrow again to move the month to December 9999. Crashes here.
I suspect the crash occurs because MonthCalendar will try to generate the items for the next month (which is beyond DateTime's range).