Wpf button click when application window is not active
- by byte
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.