Possible Duplicate:
Change custom color for Rectangle.Fill or Grid.Background
I’m trying to dynamically set a button background color from Hex in Windows Phone 7.
SolidColorBrush myBrush = new SolidColorBrush();
myBrush.Color = ColorTranslator.FromHtml("#123456");
pbMood.Background = myBrush;
ColorTranslator seems to not be available. That line gives a compiler error that it isn’t found.
Am I looking in the wrong place (a different namespace?), or is there another way to do this from code?
This class is not available in Silverlight.
Instead, you can write it yourself.