title: How to set the FontStyle of a TextBlock via Binding (MVVM)
body: <p>My snipped code of the XAML: </p>
  
  <pre><code>&lt;TextBlock Text="{Binding Name}" Foreground="{Binding FontColor}" FontStyle="{Binding FontStyleTreeItem}"/&gt;
  </code></pre>
  
  <p>Snipped code Class TreeItem:</p>
  
  <pre><code>public System.Windows.FontStyles FontStyleTreeItem {get;set}
  </code></pre>
  
  <p>I want to assign the property "FontStyleTreeItem" something like:</p>
  
  <pre><code>treeItem.FontStyleTreeItem = System.Windows.FontStyles.Italic;
  </code></pre>
  
  <p>But this doesn't work because "System.Windows.FontStyles" is static. But I can't figure out how to give a good solution to set the above property.</p>
  
  <p>I also tried to set the property as a FontStyle, so without the <strong>s</strong> at the end (FontStyle<strong>s</strong>), but then the fontstyle of the textblock doesn't change.</p>
  
  <pre><code>public FontStyle FontStyleTreeItem { get { return FontStyle.Italic; } }
  </code></pre>
  
  <p>Can somebody see what I'm missing?</p>
  
  <p>Already thanks.</p>