开发者

WPF Border Lost Focus Event

I have a border containing one textbox and two buttons. I have to run some logic on lostfocus event of the border. But what i found is, the lostfocus event of the border gets fired even when i move within the border (means i am changing the focus from the textbox to the button within the border). So everytime i change the focus within the border, the lostfocus event of the border gets fired.

I want the lostfocus to get fire only when i move out of the border.

How can i ensure that the lost focus is fired only when the border lost focus?

_One Possible Soloution _

It can be handled in code behind by using property "IsKeyboardFocusWithin" but i want generic xaml approach because i开发者_如何学C don't want to handle this for every Control from code-behind in my project..

Any suggestions??


Have a look at the FocusManager.IsFocusScope: http://msdn.microsoft.com/en-us/library/system.windows.input.focusmanager.isfocusscope.aspx Maybe it is the solution.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜