I need to make a Panel focusable in WPF, so that it captures keyboard events just as any other focusable control:
- The user clicks inside the Panel to give it focus
- any KeyDownorKeyUpevent is raised at panel level
- if another focusable element outside the panel is clicked, the panel loses focus
I experimented FocusManager.IsFocusScope="True" on the Panel and myPanel.Focus() returns true but the Panel KeyUp event handler still isn't called.
Am I missing something?