Browse Source

DateTimeUpDown: fixed bug when DateTimePart selection would not be correct when setting the Value property first in XAML.

pull/1645/head
brianlagunas_cp 15 years ago
parent
commit
8d02413ea0
  1. 11
      ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/DateTimeUpDown/Implementation/DateTimeUpDown.cs

11
ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/DateTimeUpDown/Implementation/DateTimeUpDown.cs

@ -41,7 +41,7 @@ namespace Microsoft.Windows.Controls
{ {
//if using a CustomFormat then the initialization occurs on the CustomFormatString property //if using a CustomFormat then the initialization occurs on the CustomFormatString property
if (newValue != DateTimeFormat.Custom) if (newValue != DateTimeFormat.Custom)
InitializeDateTimeInfoList(); InitializeDateTimeInfoListAndParseValue();
} }
#endregion //Format #endregion //Format
@ -67,7 +67,7 @@ namespace Microsoft.Windows.Controls
if (string.IsNullOrEmpty(newValue)) if (string.IsNullOrEmpty(newValue))
throw new ArgumentException("CustomFormat should be specified.", FormatString); throw new ArgumentException("CustomFormat should be specified.", FormatString);
InitializeDateTimeInfoList(); InitializeDateTimeInfoListAndParseValue();
} }
#endregion //FormatString #endregion //FormatString
@ -198,6 +198,13 @@ namespace Microsoft.Windows.Controls
#region Private #region Private
private void InitializeDateTimeInfoListAndParseValue()
{
InitializeDateTimeInfoList();
if (Value != null)
ParseValueIntoDateTimeInfo();
}
private void InitializeDateTimeInfoList() private void InitializeDateTimeInfoList()
{ {
_dateTimeInfoList.Clear(); _dateTimeInfoList.Clear();

Loading…
Cancel
Save