Often you want to change the colour when you perform an action to indicate to the user that something has happened. In Silverlight this can be done in may ways including using states, styles and directly changing the controls foreground or background colours.
In this example I am going to have a button inside a StackPanel. When the button is clicked I want the StackPanel’s background to change colour.
private void BtnBgcolor_Click(object sender, RoutedEventArgs e)
{
LayoutRoot.Background = new SolidColorBrush(Colors.HotPink);
}
My StackPanel is called ‘LayoutRoot‘ and I am addressing its background property by passing it a SolidColorBrush. The SolidColorBrush() allows me to pass in a color from the Windows.Media.Colors class.
Download the example from this post and take a look. If you have any issues or questions feel free to discuss them here

