I am getting a 'System.NullReferenceException' occurred in Xceed.Wpf.Toolkit.dll, exception, at stack location Xceed.Wpf.Toolkit.Core.Primitives.DateTimeUpDownBase`1.OnPreviewKeyDown().
This happens when I enter a date, in a valid format, and hit the enter key.
I have seen a few documented errors that are similar to this, but were due to a Xceed.Wpf.Toolkit v1.9 bug and has been since fixed. I am using v2.2 . Below is my xaml for the DateTimePicker in question.
<Grid DockPanel.Dock="Left">
<xctk:DateTimePicker
BorderThickness="0"
Format="Custom"
FormatString="{lex:LocText MAIN.Localization:Filters:DateRangeFilterFormatString}"
HorizontalAlignment="Right"
HorizontalContentAlignment="Stretch"
Margin="0,0,1,0"
ShowButtonSpinner="False"
TimePickerVisibility="Hidden"
Value="{Binding MinimumDate, UpdateSourceTrigger=PropertyChanged}"
VerticalAlignment="Center"
Keyboard.PreviewKeyDown="keyDownEventHandler"
Watermark="{lex:LocText MAIN.Localization:Filters:DateRangeFilterWatermark}"
Width="100"/>
</Grid>
EDIT:
I actually dont want the enter keypress to do anything on this control anyways, so I'm attempting to catch the event. I added a keyboard event in the above code. It is catching the events when im typing in a date, but when I hit enter, the error is happening before it even catches the enter key event.