开发者

Controling popup open and close focus

开发者 https://www.devze.com 2023-01-10 17:42 出处:网络
I have a popup which contains multiple elements, a list view, a text box and a button. These are operating fine, and if you use the button to close the开发者_如何学JAVA popup it works as well, but whe

I have a popup which contains multiple elements, a list view, a text box and a button. These are operating fine, and if you use the button to close the开发者_如何学JAVA popup it works as well, but when i tried to make the popup close when it lost focus, it closed when i clicked an element in the listview. Is there any way around this? Is the FocusManager property the way to go?


Set FocusManager.IsFocusScope = True on your Popup element, so it keep focus as long as one of his children has it.


Please try the stayopen property of the popup control in you code. If it is not working please post your code.


You should just set the StaysOpen property on your popup like this:

<Popup StaysOpen="True">
...
</Popup>

http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.popup.staysopen.aspx

0

精彩评论

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

关注公众号