开发者

Popups in XBAP stop receiving anything but mouse events after losing focus?

I have a Popup control in my XBAP, and whenever the popup control is open and it loses focus (such as an alert box, a breakpoint, switching to another application in Win开发者_JAVA技巧dows, switching to another Tab in my web browser, etc), the Popup no longer responds to anything but Mouse events.

I cannot:

  • Select a TextBox with the Mouse
  • Highlight Text in a TextBox with the Mouse
  • Use the Tab key to change controls
  • Select a ComboBox item using the Keyboard when I open it with the Mouse

I can:

  • Change a ComboBox value with the Mouse
  • Click a button with the Mouse


Closest thing to this problem I could find was http://social.msdn.microsoft.com/Forums/en/wpf/thread/cd723315-187f-4d8b-a97d-6aac38a2ed1f

Programmer was losing focus to their popup and never able to get it back. According to a Microsoft Supporter. "it looks like you hit a known bug related to Popup in XBAP."

You can see if it's similar to your issue, but the problem was never solved. OP ended up adding a canvas to the main page and a usercontrol to replace the popup window.


If this in fact isn't some sort of unavoidable behaviour, and I were tackling this problem from scratch, I would check when your application regains focus and see whether your application is getting both the keyboard and logical focus, and that the focus scope is correct all the way down to the controls on your popup.

In Logical focus, there is the notion of a “Focus Scope”, which is an application-defined boundary around a group of UIElements. Each Focus Scope maintains its own “Focused Element” which can be different than the element that has Keyboard focus.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜