I have a button and I want to change the background color of button. but when I set the background property to a color like blue:
I believe that your problem is caused by the default ControlTemplate for the Button control. The colour animations that you describe are defined in this ControlTemplate and so you need to provide your own ControlTemplate to remove this behaviour:
ControlTemplate
Button