private void LoadColorListBox()
{
StackPanel sp = null;
TextBox tbx = null;
TextBlock tb = null;
Type colorType = typeof(System.Windows.Media.Color);
// We take only static property to avoid properties like Name, IsSystemColor ...
PropertyInfo[] propInfos = colorType.GetProperties(BindingFlags.Public);
foreach (PropertyInfo propInfo in propInfos)
{
//Console.WriteLine(propInfo.Name);
sp = new StackPanel(); sp.Orientation = Orientation.Horizontal;//new SolidColorBrush(Colors.Blue);
tbx = new TextBox(); tbx.Width = 10; tbx.Height = 10; tbx.Background = new SolidColorBrush(Colors.Blue);
tb = new TextBlock(); tb.Text = propInfo.Name;// Colors.Blue.ToString();
sp.Children.Add(tbx); sp.Children.Add(tb);
// colorlistbox.Items.Add(sp);
}
}