Search code examples
wpfevent-handlingmouseevent

Click event dispatches to wrong control


We have the requirement that on some nondeterministic fired hardware events, depending on the event, the GUI changes. Due to the GUI complexity this may take a few seconds.

Now the problem. If I click on a button while GUI is still busy sometimes the wrong button is invoked because after GUI layouting this button is now at the mouse coordinates where the click occurred before.

Iam sure with Windows Forms the behavior was different. Can I get around this behavior?


Solution

  • You can :

    EDIT

    The real question is : what is your bottleneck ? the UI refresh or the logic behind ?