
How can I fix it?
I sent the attachment to the support address, because I don't know how to attach it in the forum.
In the attachment I enclose a sample project which shows a PopupButton which popups a ListBox, and a reference ListBox. The reference listbox becomes focused on application startup. It responds to keyboard inputs (arrow up, arrow down).
When I open the popup, the popup listbox is inactive. The keyboard events are still handled by the reference listbox - not by the popup listbox. Also the popup listbox doesn't respond to Esc key, which is supposed to close the popup. When I click the popup listbox it receives the focus and starts handling keyboard inputs (arrows, Esc).
I expected the popup listbox responded to keyboard inputs just after it is shown.
The popup listbox hovers on mouse movements (contrary to that I wrote in the previous post). I found that it does when I enable themes for application. It is fine for me.
[Modified 13 years ago]
Hi Dariusz,
I see what you mean. If you don't explicitly click in the content, it is not automatically focused when the popup is opened. We've added a new IsAutoFocusOnOpenEnabled option on the PopupButton that will focus the content when the popup is opened for the next maintenance release.
In the interim, you would have to manually focus the ListBox, possibily using the IsVisibleChanged event:
private void ListBox_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) {
var control = sender as ListBox;
if (control != null && control.IsVisible)
control.Focus();
}
Thank you for the answer. I'll check it in the maintenance release.
I found I needed this property today. Works great!
Please log in to a validated account to post comments.