From aae5cc0cb8b084838c40d812d03d36a0b89f9155 Mon Sep 17 00:00:00 2001 From: Tomasz Romaszkiewicz Date: Mon, 11 Sep 2017 11:32:55 +0200 Subject: [PATCH] Update DateTimeUpDown.cs Prevent from choosing white space, otherwise it throws exception. --- .../DateTimeUpDown/Implementation/DateTimeUpDown.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Implementation/DateTimeUpDown.cs b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Implementation/DateTimeUpDown.cs index 8d9fb97c..b285175d 100644 --- a/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Implementation/DateTimeUpDown.cs +++ b/ExtendedWPFToolkitSolution/Src/Xceed.Wpf.Toolkit/DateTimeUpDown/Implementation/DateTimeUpDown.cs @@ -825,6 +825,8 @@ namespace Xceed.Wpf.Toolkit //this only occurs when the user manually type in a value for the Value Property if( info == null ) info = (this.CurrentDateTimePart != DateTimePart.Other) ? this.GetDateTimeInfo( this.CurrentDateTimePart ) : _dateTimeInfoList[ 0 ]; + else if (string.IsNullOrWhiteSpace(info.Content)) //romasz: possible that the user will select empty space in between + info = _dateTimeInfoList[_dateTimeInfoList.IndexOf(_selectedDateTimeInfo) - 1]; DateTime? result = null;