Is it possible to set the FontWeight of a ComboBoxItem like so?
comboCategory.Items.Add("foo");
(comboCategory.Items[0] as ComboBoxItem).FontWeight = FontWeights.Bold;
Visual Studio likes this code, but at runtime i get a NullReferenceException.
Alternatively I could use this code, but I am looking for something smarter:
ComboBoxItem temp = new ComboBoxItem();
temp.FontWeight = FontWeights.Bold;
temp.Content = "foo";
comboCategory.Items.Add(temp);