views:

18

answers:

1

The Button in WPF MainWindow has normal command attribute. When clicked the handler method receives sender. But the sender is always MainWidow. How to get sender to be a Button ? I need it to be a particular button, because I set this command to several buttons and want to use single handler for many senders. Thank you

+1  A: 

Check the OriginalSource on the event arguments, it should hold the sender who invoked the command!

Hope this helps!

Arcturus
thank you! Fantastic. Thats exactly what I needed
RocketSurgeon