Mega Code Archive
Embedded Code in Window xaml
void WindowOnLoaded(object sender, RoutedEventArgs args)
{
foreach (System.Reflection.PropertyInfo prop in typeof(Brushes).GetProperties())
lstbox.Items.Add(prop.Name);
}
void ButtonOnClick(object sender, RoutedEventArgs args)
{
Button btn = sender as Button;
MessageBox.Show("The button labeled '" + btn.Content + "' has been clicked.");
}
void ListBoxOnSelection(object sender, SelectionChangedEventArgs args)
{
string strItem = lstbox.SelectedItem as string;
System.Reflection.PropertyInfo prop = typeof(Brushes).GetProperty(strItem);
elips.Fill = (Brush)prop.GetValue(null, null);
}