Monday, May 21, 2012

WPF Set Color Value based from HEXA

Here's a snippet that passes a hexa color and set a wpf control object's background/foreground property.
Code:
BrushConverter bc = new BrushConverter();   
Brush brush;   
brush = (Brush)bc.ConvertFrom("#003F87");   
notes.SetValue(TextBlock.BackgroundProperty, brush);
Original Source: http://jammer.biz/blog2/?p=169
Greg

0 comments:

Post a Comment