Change the FontStyle in code behind in WPF

c#, fonts, wpf

Solution

It was `FontStyles.Italic`... Use the `FontStyles` enum to set the value for `FontStyle`

listBoxItem.FontStyle = FontStyles.Italic;

Problem

How can I change the `FontStyle` in the code-behind in WPF. I tried this: ``` listBoxItem.FontStyle = new FontStyle("Italic"); ``` and I got error, any idea?

Original source