UserControl
.Inside that UserControl ==> One ItemsControl
.
Now ItemsControl
generating But
You are overwritting the Button's Template in your Style, so the Background color never gets used
Default button template looks like this:
And you are overwritting the template to say
You need to bind the Border's Background color to the {TemplateBinding Background}
so that it uses the Button's background color.
I would also suggest using a DataTrigger
instead of code behind to change the background color of the button.