Reputation: 1740
If I have something like this:
<Button Command="{Binding TestCommand}">Test</Button>
<Button Command="{Binding TestCommand}">another Test</Button>
TestCommand is a command object implementing ICommand.
Is it possible in the Execute function of TestCommand to detect which one of the two buttons was pressed?
I think this would be possible, if I use the object parameter, but I have other parameters to be passed, so this is not an option.
Upvotes: 0
Views: 54
Reputation: 3178
Try using CommandParameters:
<Button Command="{Binding TestCommand}"
CommandParameter="{Param, ButtonUsed}">
Test</Button>
Upvotes: 4