Click here to Skip to main content
15,885,366 members
Articles / Silverlight
Tip/Trick

Color Code to SolidColor Conversion

Rate me:
Please Sign up or sign in to vote.
4.00/5 (1 vote)
3 Jan 2012CPOL 19.5K   1   1
Convert color code to SolidColor.
C#
public SolidColorBrush GetColor(string ColorCode) 
{ 
  return (SolidColorBrush)XamlReader.Load("<SolidColorBrush xmlns=\"http://schemas." + 
     "microsoft.com/winfx/2006/xaml/presentation\ <http://schemas." + 
     "microsoft.com/winfx/2006/xaml/presentation/> " Color=\"" + ColorCode + "\" />");
}

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
India India
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
General??????? Pin
zy284092759-Jan-12 18:15
zy284092759-Jan-12 18:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.