I have a button with a Background color, and I want to send this Background color as the Command Parameter to the Command Binding! How can I do that?
<Button Background="Red" Command="{Binding ChangeColorCommand}" CommandParameter="{Binding this.Background}" />
I think you have to use RelativeSource in the binding...
<Button Background="Red" Command="{Binding ChangeColorCommand}"
CommandParameter="{Binding
RelativeSource={RelativeSource Self},
Path=Background}"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With