Browse Source

DateTimePicker: fixed null exception when setting value to null.

pull/1645/head
brianlagunas_cp 15 years ago
parent
commit
efe6cd6c69
  1. 2
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/DateTimePicker/Implementation/DateTimePicker.cs

2
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/DateTimePicker/Implementation/DateTimePicker.cs

@ -124,7 +124,7 @@ namespace Microsoft.Windows.Controls
if (_calendar != null && _calendar.SelectedDate != newValue) if (_calendar != null && _calendar.SelectedDate != newValue)
{ {
_calendar.SelectedDate = newValue; _calendar.SelectedDate = newValue;
_calendar.DisplayDate = newValue.Value; _calendar.DisplayDate = newValue ?? DateTime.Now;
} }
base.OnValueChanged(oldValue, newValue); base.OnValueChanged(oldValue, newValue);

Loading…
Cancel
Save