(Using WPF application)
The situation:
Within a WPF application, i made a WPF usercontrol, that has been placed multiple times within the application window.
In the usercontroll is a button that does something. For example just does a simple messagebox.
What i want to do is activate the button when the Enter-key is pressed.
But here is the problem.
If i would make that within the usercontrol, will it press all the buttons of each usercontrol instance in the apllication ?
What is the right way of dealing with this ?
No. When you handle Enter key, only one instance would be involved, typically one that contains input focus.
For further reading, you can start at MSDN