Wpf button click when application window is not active
Posted
by
byte
on Stack Overflow
See other posts from Stack Overflow
or by byte
Published on 2012-11-06T10:58:29Z
Indexed on
2012/11/06
11:00 UTC
Read the original article
Hit count: 183
I have a WPF application window with a button (ButtonA) which has a command binding to a View Model property.
When another application is launched the focus is lost and application window is deactivated. Clicking ButtonA now doesn’t execute the command but instead only activates the window and sets the focus to the button. 2nd click is required to fire the command.
The desired functionality is on click of ButtonA while the application window is not active, the application window activates and command associated with ButtonA is executed. I have also tried removing the command and adding a click handler for test purpose but this displays same behaviour.
I appreciate any help with this issue.
© Stack Overflow or respective owner