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:
<Button Background="SomeColor">
<Button.Content>
</Button>
And you are overwritting the template to say
<Border>
<Button.Content>
</Border>
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.
<Style TargetType="{x:Type Button}">
<Setter Property="Background" Value="Transparent" />
<Style.Triggers>
<DataTrigger Binding="{Binding }" Value="3">
<Setter Property="Background" Value="Red" />
</DataTrigger>
</Style.Triggers>
</Style>