Thursday, January 25, 2007

Is this the default behavior?

Maybe we're doing something wrong...

We have a WPF Window (very exciting, no?) and if we override the OnKeyDown method, if any child has focus, it will not get key events -- it doesn't seem to matter if the event is handled or what child has focus. This is most annoying when the child that has focus is a TextBox of some kind.

To temporarily get around this problem, we added this code:
if (FocusManager.GetFocusedElement(this) is TextBoxBase)
return;

Seems a little overkill to need to do this... i feel like I'm taking crazy pills!

No comments: