Загрузка данных


Dictionary<string, System.Windows.Media.Brush> colors = 
        new Dictionary<string, System.Windows.Media.Brush>
    {
        {"Красный",    System.Windows.Media.Brushes.Red},
        {"Синий",      System.Windows.Media.Brushes.Blue},
        {"Зелёный",    System.Windows.Media.Brushes.Green},
        {"Жёлтый",     System.Windows.Media.Brushes.Yellow},
        {"Оранжевый",  System.Windows.Media.Brushes.Orange},
        {"Фиолетовый", System.Windows.Media.Brushes.Purple},
        {"Розовый",    System.Windows.Media.Brushes.Pink},
        {"Чёрный",     System.Windows.Media.Brushes.Black},
        {"Серый",      System.Windows.Media.Brushes.Gray},
        {"Коричневый", System.Windows.Media.Brushes.Brown}
    };

    if (colors.ContainsKey(rb.Content.ToString()))
        tbSample.Foreground = colors[rb.Content.ToString()];
}