ToSolidColorBrush
Converts a uint (0xFFb2b2b2) to a Silverlight SolidColorBrush object.
Source
public static Color ToColor(this uint argb)
{
return Color.FromArgb((byte)((argb & -16777216) >> 0x18),
(byte)((argb & 0xff0000) >> 0x10),
(byte)((argb & 0xff00) >> 8),
(byte)(argb & 0xff));
}
public static SolidColorBrush ToSolidColorBrush(this uint argb)
{
return new SolidColorBrush(argb.ToColor());
}
Example
MyRectangle.Fill = 0xFFb2b2b2.ToSolidColorBrush();