System.Windows.Controls.Button b = new System.Windows.Controls.Button(); b.Content = "OK"; b.Background = System.Windows.Media.Brushes.Red; For more WPF interview question please check this link... http://mindstick.com/Interview/401/How%20to%20change%20backcolor%20of%20button%20control%20dynamically
There is no Burshes class it is Brushes class............
To change the background color of a button dynamically in WPF
System.Windows.Controls.Button b1=new System.Windows.Controls.Button();
b1.Background=System.Windows.Media.Brushes.Blue;
System.Windows.Controls.Button objButtton=new System.Windows.Controls.Button();
objButton.Background=System.Windows.Media.Burshes.Red;