Quantcast
Channel: Extended WPF Toolkit™ Community Edition
Viewing all articles
Browse latest Browse all 4964

Commented Unassigned: DateTimePicker seems broken on new build [22295]

$
0
0
Hello.

I just wanted to report an issue that I encountered today when I updated my nuget packet to the new build.

I have an application that I've had developed for quite a while that used the DateTimePicker as part of search criteria in an MVVM light viewmodel. It worked fine until I updated the package.

I downloaded and referenced the 2.8 libraries and things worked again. So, i'm unsure if something changed that perhaps I am violating, or there may be an issue.

For reference, in my viewmodel I have a property defined as below:

```
private DateTime? _createdAfter = null;
public DateTime? CreatedAfter
{
get
{
if (IsInDesignMode) { return new DateTime(2012, 12, 12); }
else { return _createdAfter; }
}
set
{
if (_createdAfter != value)
{
_createdAfter = value;
RaisePropertyChanged(() => CreatedAfter);
}
}
}
```

Bound to the DateTimePicker as thus:
```

<xctk:DateTimePicker Format="Custom" Value="{Binding CreatedAfter, Mode=TwoWay}" />
```

After updating I got the following error:

__Index was out of range. Must be non-negative and less than the size of the collection.__

with this stack trace error:

at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at Xceed.Wpf.Toolkit.DateTimeUpDown.OnValueChanged(Nullable`1 oldValue, Nullable`1 newValue)
at Xceed.Wpf.Toolkit.DateTimePicker.OnValueChanged(Nullable`1 oldValue, Nullable`1 newValue)
at Xceed.Wpf.Toolkit.Primitives.UpDownBase`1.OnValueChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
at System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
at System.Windows.DependencyObject.ClearValueCommon(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata)
at System.Windows.DependencyObject.ClearValue(DependencyProperty dp)
Comments: ** Comment from web user: BoucherS **

In v3.2, the DateTimePicker will throw if the FormatString property is null when Format property is set to "Custom".


Viewing all articles
Browse latest Browse all 4964

Trending Articles