I have a number of Buttons like this
<Button Content="A"
Command="{Binding ClickCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self},
Path=Content}" />
where the Content
property of the Button is being passed as the CommandParameter
. A single Command in the ViewModel handles all the Buttons and 'knows what to do' based on that parameter (think of a control panel / keyboard type app).
This makes for a lot of repeated XAML. How can I put this repeated code into the base style for a Button?