From 8e22d5cf2c300b339226d53412025f9f37cc008a Mon Sep 17 00:00:00 2001 From: brianlagunas_cp Date: Mon, 16 May 2011 14:53:38 +0000 Subject: [PATCH] DateTimePicker: fixed issue with custom format and binding the same dateTime to multiple DateTime controls. --- .../DateTimeUpDown/Implementation/DateTimeUpDown.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/DateTimeUpDown/Implementation/DateTimeUpDown.cs b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/DateTimeUpDown/Implementation/DateTimeUpDown.cs index a2064153..7b366bc0 100644 --- a/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/DateTimeUpDown/Implementation/DateTimeUpDown.cs +++ b/ExtendedWPFToolkitSolution/Src/WPFToolkit.Extended/DateTimeUpDown/Implementation/DateTimeUpDown.cs @@ -55,7 +55,10 @@ namespace Microsoft.Windows.Controls { _dateTimeParser.Format = GetFormatString(newValue); InitializeDateTimeInfoListAndParseValue(); - Text = ConvertValueToText(); + + //I forgot why I set the text here. I believe it had to deal with databinding to the format. Either way we need to make sure there is a value before we try to set the text. + if (Value.HasValue) + Text = ConvertValueToText(); } #endregion //Format