I've added a MouseDown
event to my window.
In this window I've several Buttons with Click events.
The problem is, that the MouseDown
event from my window is also activated, when I click on one of my buttons.
How can I solve this problem?
I've added a MouseDown
event to my window.
In this window I've several Buttons with Click events.
The problem is, that the MouseDown
event from my window is also activated, when I click on one of my buttons.
How can I solve this problem?
One Approach was already mentioned by Raviraj Palvankar in the comments of your question, I'm just going to write it out: Your button recognizes that the mouse-down Event has been triggered, the problem is, that you don't "exit" this "state" For short: There is an option called
e.Handled = true;
This will "clear" the event, so it won't trigger again Also useful for textinput method when you want to validate the pressed key but don't want the key to be displayed in the textbox