I've implemented an attached property that when applied, will watch for the PreviewKeyDown event and call:
item.MoveFocus(
new TraversalRequest(FocusNavigationDirection.Next));
when it sees the Enter key pressed. This works great for standard WPF controls (i.e. TextBox, ComboBox, etc), however the Infragistics masked edit controls (i.e. XamDateTimeEditor, and XamCurrencyEditor) don't work as expected. When I hit the TAB key to put focus onto a masked edit control, it works correctly. However, when I call the above line of code, the SelectionsList element of the masked editor gets focus. When this happens, I'm unable to edit or call MoveFocus to get out of the control.
Any ideas? I've attached a file with the code I'm using to call MoveFocus.
Two things stand out to me. First, you're using the e.Source which is going to be the sender (the xamMaskedEditor in this case) and not the element with focus for which the event is being raised. You should probably be using e.OriginalSource. Second, you should probably be marking the event as handled or the control that is receiving the input focus is going to receive an Enter key press.
Your first point makes sense. The second point was the one that fixed my issue. I left the event unhandled on purpose because I wanted to be as unintrusive as possible. I'm still not clear on why marking it as handled has corrected my issue, other than maybe the infragistics controls are reacting to that key press and are doing something to undo my navigation. I can see how marking handled would make sense so I'm fine with that change. Thanks!