I am wondering if anybody knows why the datepicker will pass standard keys to any parent control's key down routed event, but not the return key?
here's the xaml i wrote:
<WrapPanel Name="_wpParameters"
Grid.Row="0" Grid.Column="0"
Orientation="Horizontal"
Grid.IsSharedSizeScope="True"
Keyboard.KeyDown="_wpParameters_KeyDown" >
<!-- this is where the dynamic parameter controls will be added -->
</WrapPanel>
Here is the code i was using to check for the return key:
private void _wpParameters_KeyDown(object sender, KeyEventArgs e)
{
if (e.Key == Key.Return)
{
RaiseEvent(new RoutedEventArgs(LoadLiveResultsEvent, this));
}
}
I was using key down on accident (meant to use key up) but I found it interesting that the standard numeric and / characters were firing the logic, but not the return key. Any Idea's why the return key is not included as a key down key?
The KeyDown event is a lower-level text input event that might not behave as expected on certain controls. This is because some controls have control compositing or class handling that provides a higher-level version of text input handling and related events.
As viewed on MSDN...my assumption is that the control is consuming the event and perhaps committing the text to the bindable source and other cleanup and then marking the event as handled.