tags:

views:

176

answers:

3

I want to get notified when I click a window in WPF (I use the GotFocus event), but it only triggers when I click on a Combobox in the window. What I want is to get notified when the the window or any of the controls in the window is clicked. Any ideas of how to do this?

+2  A: 

Use Activated event instead of GotFocus.

maciejkow
A: 

You could try the IsKeyboardFocusWithinChanged event. It should trigger when the keyboard focus is taken by an element of the window, or when it is taken by another window

Thomas Levesque
+3  A: 

The GotFocus event doesn't get fired when the Window gets focus, it's intended to be used with controls only. The Activated event serves this particular purpose.

kek444